コード例 #1
0
ファイル: test_geocachingdotcom.py プロジェクト: rknuus/caspr
 def test_task_with_two_variables_on_same_line(self):
     expected = [Task(description='irrelevant,', variables='A'), Task(description='tant pis', variables='A')]
     parser = DescriptionParser()
     actual = parser.parse('A = irrelevant, A = tant pis')
     self.assertEqual(expected, list(actual))
コード例 #2
0
ファイル: test_geocachingdotcom.py プロジェクト: rknuus/caspr
 def test_task_with_multiple_variables(self):
     expected = [Task(description='foo bar baz', variables='ABCDEF')]
     parser = DescriptionParser()
     actual = parser.parse('ABCDEF = foo bar baz')
     self.assertEqual(expected, list(actual))
コード例 #3
0
ファイル: test_geocachingdotcom.py プロジェクト: rknuus/caspr
 def test_task_with_same_variable_repeated(self):
     expected = [Task(description='irrelevant', variables='A'), Task(description='tant pis', variables='A')]
     parser = DescriptionParser()
     actual = parser.parse('A = irrelevant\nA = tant pis')
     self.assertEqual(expected, list(actual))
コード例 #4
0
ファイル: test_geocachingdotcom.py プロジェクト: rknuus/caspr
 def test_task_with_preface(self):
     expected = [Task(description='foo bar baz', variables='A')]
     parser = DescriptionParser()
     actual = parser.parse('irrelevant\nA = foo bar baz')
     self.assertEqual(expected, list(actual))
コード例 #5
0
ファイル: test_geocachingdotcom.py プロジェクト: rknuus/caspr
 def test_two_tasks(self):
     expected = [Task(description='foo bar baz', variables='A'), Task(description='nope', variables='Z')]
     parser = DescriptionParser()
     actual = parser.parse('A = foo bar baz\nZ = nope')
     self.assertEqual(expected, list(actual))
コード例 #6
0
ファイル: test_geocachingdotcom.py プロジェクト: rknuus/caspr
 def test_one_task(self):
     expected = [Task(description='foo bar baz', variables='A')]
     parser = DescriptionParser()
     actual = parser.parse('A = foo bar baz')
     self.assertEqual(expected, list(actual))
コード例 #7
0
ファイル: test_geocachingdotcom.py プロジェクト: rknuus/caspr
 def test_no_variable_definition_returns_empty_tasks(self):
     parser = DescriptionParser()
     tasks = parser.parse('foo bar baz')
     self.assertEqual(len(list(tasks)), 0)
コード例 #8
0
ファイル: test_geocachingdotcom.py プロジェクト: rknuus/caspr
 def test_no_iteration_if_data_empty(self):
     parser = DescriptionParser()
     tasks = parser.parse('')
     self.assertEqual(len(list(tasks)), 0)