Beispiel #1
0
 def test_unused_case_all(self, unused_case_archive, mock_suites):
     resultspec = ''
     results = resolve_resultspec(unused_case_archive, mock_suites,
                                  resultspec)
     try:
         for result in results:
             print(result)
     except AbortError as e:
         assert 'no result recorded' in str(e)
Beispiel #2
0
 def test_unused_case(self, unused_case_archive, mock_suites):
     resultspec = 'a/2'
     try:
         resolve_resultspec(unused_case_archive, mock_suites, resultspec)
     except AbortError as e:
         assert 'no result recorded' in str(e)
Beispiel #3
0
 def test_most_recent_missing(self, archive, mock_suites):
     resultspec = 'a/huh'
     try:
         resolve_resultspec(archive, mock_suites, resultspec)
     except AbortError as e:
         assert 'the case "huh" does not exist within suite "a"' in str(e)
Beispiel #4
0
 def test_existing_file(self, archive, mock_suites, mock_results):
     resultspec = archive._result_filename('a', '1', 'r1')
     assert list(resolve_resultspec(archive, mock_suites,
                                    resultspec)) == [mock_results[0]]
Beispiel #5
0
 def test_most_recent_in_suite(self, archive, mock_suites, mock_results):
     resultspec = 'a'
     assert list(resolve_resultspec(archive, mock_suites, resultspec)) == [
         mock_results[1], mock_results[2]
     ]
Beispiel #6
0
 def test_most_recent_all(self, archive, mock_suites, mock_results):
     resultspec = ''
     results = list(resolve_resultspec(archive, mock_suites, resultspec))
     assert results == [mock_results[1], mock_results[2], mock_results[3]]
Beispiel #7
0
 def test_fully_qualified_missing(self, archive, mock_suites):
     resultspec = 'a/1/huh'
     with pytest.raises(AbortError):
         resolve_resultspec(archive, mock_suites, resultspec)
Beispiel #8
0
 def test_relative_index_3(self, archive, mock_suites, mock_results):
     resultspec = 'a/1/~2'
     with pytest.raises(AbortError):
         assert resolve_resultspec(archive, mock_suites, resultspec)
Beispiel #9
0
 def test_relative_index_2(self, archive, mock_suites, mock_results):
     resultspec = 'a/1/~1'
     assert list(resolve_resultspec(archive, mock_suites,
                                    resultspec)) == [mock_results[0]]
Beispiel #10
0
 def test_fully_qualified(self, archive, mock_suites, mock_results):
     resultspec = 'a/1/101_r2'
     assert list(resolve_resultspec(archive, mock_suites,
                                    resultspec)) == [mock_results[1]]
Beispiel #11
0
 def test_nonexistant_file(self, archive, mock_suites):
     resultspec = archive._result_filename('a', '1', 'huh')
     with pytest.raises(AbortError):
         resolve_resultspec(archive, mock_suites, resultspec)