コード例 #1
0
 def test200_955_ShouldRaiseErrorOnDuplicateStarInSameFile(self):
     expectedString = "StarCatalog.loadCatalog:"
     theCat = SC.StarCatalog()
     with self.assertRaises(ValueError) as context:
         theCat.loadCatalog("saoLocalWithDuplicates.txt", 2.0)
     self.assertEquals(
         expectedString, context.exception.args[0][0:len(expectedString)],
         "Major:  failure to check for invalid degradation value")
     self.assertEquals(0, theCat.getStarCount())
コード例 #2
0
 def test100_010_ShouldConstruct(self):
     self.assertIsInstance(SC.StarCatalog(), SC.StarCatalog)
コード例 #3
0
 def test_300_003_getStarCountWithAllStars(self):
     stars = StarCatalog.StarCatalog()
     starCount = stars.loadCatalog(
         starFile="/home/softwareprocess/Desktop/sao.txt")
     allStars = stars.getStarCount()
     print allStars
コード例 #4
0
 def test_300_900_getStarCountWithInValidMagnitude(self):
     stars = StarCatalog.StarCatalog()
     starCount = stars.loadCatalog(
         starFile="/home/softwareprocess/Desktop/sao.txt")
     self.assertRaises(stars.getStarCount('a', 5), ValueError)
コード例 #5
0
 def test_300_002_getStarCountWithMagnitudeGreaterThan3(self):
     stars = StarCatalog.StarCatalog()
     starCount = stars.loadCatalog(
         starFile="/home/softwareprocess/Desktop/sao.txt")
     starsGE3 = stars.getStarCount(dimmest=3)
     print starsGE3
コード例 #6
0
 def test_300_001_getStarCountWithMagnitudeLessThan5(self):
     stars = StarCatalog.StarCatalog()
     starCount = stars.loadCatalog(
         starFile="/home/softwareprocess/Desktop/sao.txt")
     starsLE5 = stars.getStarCount(brightest=5)
     print starsLE5
コード例 #7
0
 def test_300_000_getStarCountBetween2and5(self):
     stars = StarCatalog.StarCatalog()
     starCount = stars.loadCatalog(
         starFile="/home/softwareprocess/Desktop/sao.txt")
     starsBetween2And5 = stars.getStarCount(dimmest=5, brightest=2)
     print starsBetween2And5
コード例 #8
0
 def test_200_900_loadStarsFromInValidFile(self):
     stars = StarCatalog.StarCatalog()
     self.assertRaises(
         stars.loadCatalog(
             starFile="/home/softwareprocess/Desktop/test.txt"), ValueError)
コード例 #9
0
 def test_200_000_loadStarsFromValidFile(self):
     stars = StarCatalog.StarCatalog()
     starCount = stars.loadCatalog(
         starFile="/home/softwareprocess/Desktop/sao.txt")
     print starCount