Skip to content

Commit 7463f92

Browse files
committed
Removed any_barcode_matches method from record class, as it's not used anymore following refactoring
1 parent 6c28061 commit 7463f92

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

dls_barcode/data_store/record.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,6 @@ def to_string(self):
123123
items[Record.IND_GEOMETRY] = self.geometry.serialize()
124124
return Record.ITEM_SEPARATOR.join(items)
125125

126-
def any_barcode_matches(self, barcodes):
127-
""" Returns true if the record contains any barcode which is also
128-
contained in the specified list
129-
"""
130-
valid_barcodes = [bc for bc in barcodes if bc not in Record.BAD_SYMBOLS]
131-
for bc in valid_barcodes:
132-
if bc in self._all_barcodes():
133-
return True
134-
135-
return False
136-
137126
def _all_barcodes(self):
138127
return [self.holder_barcode] + self.barcodes
139128

tests/unit_tests/test_dls_barcode/test_data_store/test_record.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,6 @@ def test_to_string_recreates_given_values_excluding_serial_number(self):
5656
for i in range(len(list_str) - 1):
5757
self.assertTrue(list_str[i] == list_new_str[i])
5858

59-
def test_any_barcode_matches_returns_true_if_only_one_barcode_matches(self):
60-
# Arrange
61-
str = "f59c92c1;1494238920.0;test.png;None;DLSL-010,DLSL-011,DLSL-012;1569:1106:70-2307:1073:68-1944:1071:68"
62-
r = Record.from_string(str)
63-
64-
# Act-Assert
65-
self.assertTrue(r.any_barcode_matches(['DLSL-010','DLSL-011111']))
66-
67-
def test_any_barcode_matches_returns_false_if_no_barcode_matches(self):
68-
# Arrange
69-
str = "f59c92c1;1494238920.0;test.png;None;DLSL-010,DLSL-011,DLSL-012;1569:1106:70-2307:1073:68-1944:1071:68"
70-
r = Record.from_string(str)
71-
72-
# Act-Assert
73-
self.assertFalse(r.any_barcode_matches(['DLSL', 'DLSL3']))
74-
75-
def test_any_barcode_matches_returns_false_if_no_barcodes_passed(self):
76-
# Arrange
77-
str = "f59c92c1;1494238920.0;test.png;None;DLSL-010,DLSL-011,DLSL-012;1569:1106:70-2307:1073:68-1944:1071:68"
78-
r = Record.from_string(str)
79-
80-
# Act=Assert
81-
self.assertFalse(r.any_barcode_matches([]))
82-
8359
def test_csv_string_contains_time_in_human_readable_format(self):
8460
# Arrange
8561
timestamp = 1505913516.3836024

0 commit comments

Comments
 (0)