Exemplo n.º 1
0
    def leaderboards(self):
        with patch('requests.post') as m:
            m.return_value = MagicMock()
            m.return_value.text = '{"id":1}'
            c = Client('test')

        with patch('requests.get') as mock:
            mock.return_value = MagicMock()
            mock.return_value.text = '[]'
            assert (c.leaderboards() == [])
Exemplo n.º 2
0
    def leaderboards(self):
        with patch("requests.post") as m:
            m.return_value = MagicMock()
            m.return_value.text = '{"id":1}'
            c = Client("test")

        with patch("requests.get") as mock:
            mock.return_value = MagicMock()
            mock.return_value.text = "[]"
            assert c.leaderboards() == []