Skip to content

Commit

Permalink
Make tests pass again
Browse files Browse the repository at this point in the history
Fix minor issues preventing the tests from running.

PNDA-2415
  • Loading branch information
jeclarke committed Nov 14, 2016
1 parent 4e4a7ab commit 83fed98
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ echo -n "Code quality (data-service) : "
cd ${BASE}/data-service/src/main/resources
check_pylint

nosetests tests/*.py
[[ $? -ne 0 ]] && exit -1

echo -n "Code quality (hdfs-cleaner) : "
cd ${BASE}/hdfs-cleaner/src/main/resources
check_pylint
Expand Down
2 changes: 0 additions & 2 deletions data-service/src/main/resources/dataservice/hdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,3 @@ def delete_dataset(self, data):
table.delete(data['id'])
except TException as exception:
logging.warn("Failed to delete dataset in hbase, error(%s):", exception.message)


Empty file.
11 changes: 5 additions & 6 deletions data-service/src/main/resources/tests/test_hdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import mock as mock
from mock import Mock
from mock import MagicMock
from dataservice import HDBDataStore
from ..dataservice import HDBDataStore


def get_repo_samples1():
Expand All @@ -36,9 +36,9 @@ def get_repo_samples1():

def get_repo_samples2(error):
if error is True:
item1 = {"id": 'sample1', 'policy': 'Integrity error', 'path': 'repo', 'retention': '222'}
item2 = {"id": 'sample2', 'policy': 'Integrity error', 'path': 'repo', 'retention': '222'}
item3 = {"id": 'sample3', 'policy': 'Integrity error', 'path': 'repo', 'retention': '222'}
item1 = {"id": 'sample1', 'policy': 'integrity_error', 'path': 'repo', 'retention': '222'}
item2 = {"id": 'sample2', 'policy': 'integrity_error', 'path': 'repo', 'retention': '222'}
item3 = {"id": 'sample3', 'policy': 'integrity_error', 'path': 'repo', 'retention': '222'}
else:
item1 = {"id": 'sample1', 'policy': 'age', 'path': 'repo', 'retention': '222'}
item2 = {"id": 'sample2', 'policy': 'age', 'path': 'repo', 'retention': '222'}
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_collect_intersection(self, hbase):
datasets = db1.read_datasets()
for i in datasets:
if i['id'] == 'test5':
self.assertEqual(i['policy'], 'Integrity error')
self.assertEqual(i['policy'], 'integrity_error')
elif i['id'] == 'test3':
self.assertEqual(i['policy'], 'keep')

Expand Down Expand Up @@ -162,4 +162,3 @@ def test_write_dataset(self):
db1.write_dataset(sample_data)
table.put.assert_called_once_with('test', {'cf:mode': 'archive', 'cf:policy': 'age',
'cf:path': 'repo', 'cf:retention': '222'})

0 comments on commit 83fed98

Please sign in to comment.