예제 #1
0
 def test_010_730_shouldHandleNonExistentBody(self):
     test_input = {'body': 'unknown'}
     expected = {'body': 'unknown', 'error': 'star not in catalog'}
     actual = predict.extractBody(test_input)
     self.assertIsNone(actual)
     self.assertEqual(test_input, expected,
                      'Should handle nonexistent star name')
예제 #2
0
 def test_010_720_shouldHandleNonStringBody(self):
     test_input = {'body': 7}
     expected = {'body': 7, 'error': 'invalid body'}
     actual = predict.extractBody(test_input)
     self.assertIsNone(actual)
     self.assertEqual(test_input, expected, 'Should handle non-string body')
예제 #3
0
 def test_010_710_shouldHandleMissingBody(self):
     test_input = {}
     expected = {'error': 'mandatory information is missing'}
     actual = predict.extractBody(test_input)
     self.assertIsNone(actual)
     self.assertEqual(test_input, expected, 'Should handle missing body')
예제 #4
0
 def test_010_030_shouldExtractBodyMixedcase(self):
     test_input = {'body': 'BeTeLGeUsE'}
     expected = {'sha': '270d59.1', 'declination': '7d24.3'}
     actual = predict.extractBody(test_input)
     self.assertEqual(actual, expected, 'Should extract mixedcase body')
예제 #5
0
 def test_010_020_shouldExtractBodyUppercase(self):
     test_input = {'body': 'BETELGEUSE'}
     expected = {'sha': '270d59.1', 'declination': '7d24.3'}
     actual = predict.extractBody(test_input)
     self.assertEqual(actual, expected, 'Should extract uppercase body')
예제 #6
0
 def test_010_010_shouldExtractBodyLowercase(self):
     test_input = {'body': 'betelgeuse'}
     expected = {'sha': '270d59.1', 'declination': '7d24.3'}
     actual = predict.extractBody(test_input)
     self.assertEqual(actual, expected, 'Should extract lowercase body')