class TestsStuff(unittest.TestCase): def setUp(self): self.gateway_mock = mock.Mock() self.uut = Stuff(TYPE, NAME, self.gateway_mock) def assertIsAvailable(self, result): self.assertIsNone(result.user_name) self.assertIsNone(result.reservation_start) @unittest.skip('na winnie przejdzie') def test_when_called_release_then_invoke_release(self): self.uut.release() self.gateway_mock.release.assert_called_once(TYPE, NAME) def test_when_reserve_called_then_invoke_reserved(self): self.uut.reserve(USER) self.gateway_mock.reserve.assert_called_once_with(TYPE, NAME, USER) def test_when_status_called_then_invoke_status(self): self.gateway_mock.get_active_reservations.return_value = [] self.assertIsAvailable(self.uut.status())
def setUp(self): self.gateway_mock = mock.Mock() self.uut = Stuff(TYPE, NAME, self.gateway_mock)