class TestSession(unittest.TestCase): def setUp(self): self.resource = Sessions("uri", ("username", "token")) def test_list(self): with patch.object(self.resource, "get_instances") as mock: self.resource.list(limit=10, page=1) mock.assert_called_with({ "limit": 10, "page": 1, "search": False, }) def test_delete(self): with patch.object(self.resource, "delete_instance") as mock: self.resource.delete(9090) mock.assert_called_with(9090)
class TestSession(unittest.TestCase): def setUp(self): self.resource = Sessions("uri", ("username", "token")) def test_list(self): with patch.object(self.resource, "get_instances") as mock: self.resource.list( limit=10, page=1 ) mock.assert_called_with({ "limit": 10, "page": 1, "search": False, }) def test_delete(self): with patch.object(self.resource, "delete_instance") as mock: self.resource.delete(9090) mock.assert_called_with(9090)
def setUp(self): self.resource = Sessions("uri", ("username", "token"))