def test_yeast_model_raises(self): with self.assertRaises(YeastException) as ctx: YeastModel(u"not an allowed method") self.assertEquals( str(ctx.exception), u"Method 'not an allowed method' not allowed for yeast model", ) # noqa
class TestYeastModel(unittest.TestCase): def setUp(self): self.yeast_model = YeastModel(u'stir plate') def test_yeast_model_raises(self): with self.assertRaises(Exception): YeastModel(u'not an allowed method') def test_get_growth_rate(self): inoculation_rate = 6.17 with self.assertRaises(NotImplementedError): self.yeast_model.get_growth_rate(inoculation_rate) def test_get_inoculation_rate(self): growth_rate = 4.44 with self.assertRaises(NotImplementedError): self.yeast_model.get_inoculation_rate(growth_rate)
class TestYeastModel(unittest.TestCase): def setUp(self): self.yeast_model = YeastModel(u'stir plate') def test_yeast_model_raises(self): with self.assertRaises(YeastException) as ctx: YeastModel(u'not an allowed method') self.assertEquals(str(ctx.exception), u"Method 'not an allowed method' not allowed for yeast model") # noqa def test_get_growth_rate(self): inoculation_rate = 6.17 with self.assertRaises(NotImplementedError): self.yeast_model.get_growth_rate(inoculation_rate) def test_get_inoculation_rate(self): growth_rate = 4.44 with self.assertRaises(NotImplementedError): self.yeast_model.get_inoculation_rate(growth_rate)
class TestYeastModel(unittest.TestCase): def setUp(self): self.yeast_model = YeastModel(u"stir plate") def test_yeast_model_raises(self): with self.assertRaises(YeastException) as ctx: YeastModel(u"not an allowed method") self.assertEquals( str(ctx.exception), u"Method 'not an allowed method' not allowed for yeast model", ) # noqa def test_get_growth_rate(self): inoculation_rate = 6.17 with self.assertRaises(NotImplementedError): self.yeast_model.get_growth_rate(inoculation_rate) def test_get_inoculation_rate(self): growth_rate = 4.44 with self.assertRaises(NotImplementedError): self.yeast_model.get_inoculation_rate(growth_rate)
def setUp(self): self.yeast_model = YeastModel(u'stir plate')
def setUp(self): self.yeast_model = YeastModel(u"stir plate")