示例#1
0
 def test_dev_stats(self):
     self.dev = Developer(name="Turing")
     self.assertEqual(self.dev.stats, {
         "name": "Turing",
         "type": "developer",
         "happy": 100,
         "stress": 0,
     },
                      msg="Wrong developer stats")
示例#2
0
class TestDeveloperBasics(unittest.TestCase):
    def setUp(self):
        self.dev = Developer()

    def test_dev_stats(self):
        self.dev = Developer(name="Turing")
        self.assertEqual(self.dev.stats, {
            "name": "Turing",
            "type": "developer",
            "happy": 100,
            "stress": 0,
        },
                         msg="Wrong developer stats")

    @patch('game.software.Software')
    def test_developer_code(self, software):
        """Check if developer has code method code"""
        self.assertEqual(self.dev.develop(software),
                         True,
                         msg="Developer has no coding method")

    @patch('game.software.Software')
    def test_developer_code_on_100(self, software):
        """Check if developer cannot code more than 100"""
        software.add_code.return_value = False
        self.assertEqual(self.dev.develop(software),
                         False,
                         msg="Developer can code beyond 100 completion")

    @patch('game.software.Software')
    def test_developer_release_software(self, software):
        """Check if developer can release software"""
        software.be_released.return_value = True
        self.assertEqual(self.dev.release(software),
                         True,
                         msg="Developer cannot release software")
示例#3
0
 def setUp(self):
     self.comp = Company()
     self.dev = Developer()
示例#4
0
def step_impl(context):
    context.dev = Developer()
    context.soft = Software("Test")
示例#5
0
def step_impl(context):
    context.dev = Developer()
    context.soft = Software("Test")
    context.soft.stats["completion"] = 99
示例#6
0
 def setUp(self):
     self.dev = Developer()