コード例 #1
0
class TestReply(unittest.TestCase):
    def setUp(self):
        self.resource = Replies("uri", ("username", "token"))

    def test_list(self):
        with patch.object(self.resource, "get_instances") as mock:
            self.resource.list(
                limit=25,
                page=2,
            )
            mock.assert_called_with({"limit": 25, "page": 2, "search": False})

    def test_list_search(self):
        with patch.object(self.resource, "get_instances") as mock:
            self.resource.list(
                limit=10,
                page=5,
                search=True,
            )
            mock.assert_called_with({"limit": 10, "page": 5, "search": True})

    def test_delete(self):
        with patch.object(self.resource, "delete_instance") as mock:
            self.resource.delete(123)
            mock.assert_called_with(123)
コード例 #2
0
class TestReply(unittest.TestCase):

    def setUp(self):
        self.resource = Replies("uri", ("username", "token"))

    def test_list(self):
        with patch.object(self.resource, "get_instances") as mock:
            self.resource.list(
                limit=25,
                page=2,
            )
            mock.assert_called_with({
                "limit": 25,
                "page": 2,
                "search": False
            })

    def test_list_search(self):
        with patch.object(self.resource, "get_instances") as mock:
            self.resource.list(
                limit=10,
                page=5,
                search=True,
            )
            mock.assert_called_with({
                "limit": 10,
                "page": 5,
                "search": True
            })

    def test_delete(self):
        with patch.object(self.resource, "delete_instance") as mock:
            self.resource.delete(123)
            mock.assert_called_with(123)
コード例 #3
0
 def setUp(self):
     self.resource = Replies("uri", ("username", "token"))
コード例 #4
0
 def setUp(self):
     self.resource = Replies("uri", ("username", "token"))