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())
def test100_010_ShouldConstruct(self): self.assertIsInstance(SC.StarCatalog(), SC.StarCatalog)
def test_300_003_getStarCountWithAllStars(self): stars = StarCatalog.StarCatalog() starCount = stars.loadCatalog( starFile="/home/softwareprocess/Desktop/sao.txt") allStars = stars.getStarCount() print allStars
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)
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
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
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
def test_200_900_loadStarsFromInValidFile(self): stars = StarCatalog.StarCatalog() self.assertRaises( stars.loadCatalog( starFile="/home/softwareprocess/Desktop/test.txt"), ValueError)
def test_200_000_loadStarsFromValidFile(self): stars = StarCatalog.StarCatalog() starCount = stars.loadCatalog( starFile="/home/softwareprocess/Desktop/sao.txt") print starCount