Skip to content

Commit

Permalink
ODE-1234 included config.ini in the package
Browse files Browse the repository at this point in the history
  • Loading branch information
hmusavi committed Apr 5, 2019
1 parent e2262eb commit a228781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 4 additions & 6 deletions odevalidator/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def check_value(self, data_field_value, data):


class TestCase:
def __init__(self, filepath):
def __init__(self, filepath="odevalidator/config.ini"):
assert Path(filepath).is_file(), "Configuration file '%s' could not be found" % filepath
self.config = configparser.ConfigParser()
self.config.read(filepath)
Expand All @@ -134,7 +134,7 @@ def validate_queue(self, msg_queue):
msg_list = []
while not msg_queue.empty():
line = msg_queue.get()
if line and not line.startswith("#"):
if line and not str.startswith(str(line), '#'):
current_msg = json.loads(line)
msg_list.append(current_msg)
record_id = str(current_msg['metadata']['serialId']['recordId'])
Expand Down Expand Up @@ -167,11 +167,9 @@ def validate_queue(self, msg_queue):

# main function using old functionality
def test():
config_file = "odevalidator/config.ini"
#config_file = "odevalidator/config.ini"
# Parse test config and create test case
validator = TestCase(config_file)

print("[START] Beginning test routine referencing configuration file '%s'." % config_file)
validator = TestCase()

data_file = "test/good.json"
results = test_file(validator, data_file)
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from setuptools import setup
from setuptools import setup, find_packages

setup(
name="odevalidator",
version="0.0.2",
author_email="[email protected]",
description="ODE Data Validation Library",
packages=['odevalidator']
packages=['odevalidator'],
package_data={'': ['config.ini']},
include_package_data=True,
)

0 comments on commit a228781

Please sign in to comment.