コード例 #1
0
class TestDeleteMessageCommand(unittest.TestCase):
    def setUp(self):
        self.client = client.PushwooshClient()
        self.command = DeleteMessageCommand()
        self.auth = 'Test auth'
        self.command.auth = self.auth

    def test_valid_delete(self):
        message_code = 'message_code'
        expected_result = {
            'request': {
                'message': message_code,
                'auth': self.auth
            }
        }
        self.command.message = message_code

        command_dict = json.loads(self.command.render())
        self.assertDictEqual(command_dict, expected_result)

    def test_delete_without_message(self):
        self.assertRaises(PushwooshCommandException, self.command.compile)
コード例 #2
0
class TestDeleteMessageCommand(unittest.TestCase):

    def setUp(self):
        self.client = client.PushwooshClient()
        self.command = DeleteMessageCommand()
        self.auth = 'Test auth'
        self.command.auth = self.auth

    def test_valid_delete(self):
        message_code = 'message_code'
        expected_result = {
            'request': {
                'message': message_code,
                'auth': self.auth
            }
        }
        self.command.message = message_code

        command_dict = json.loads(self.command.render())
        self.assertDictEqual(command_dict, expected_result)

    def test_delete_without_message(self):
        self.assertRaises(PushwooshCommandException, self.command.compile)
コード例 #3
0
 def setUp(self):
     self.client = client.PushwooshClient()
     self.command = DeleteMessageCommand()
     self.auth = 'Test auth'
     self.command.auth = self.auth
コード例 #4
0
 def setUp(self):
     self.client = client.PushwooshClient()
     self.command = DeleteMessageCommand()
     self.auth = 'Test auth'
     self.command.auth = self.auth
コード例 #5
0
    def setUp(self):
        super(TestDeleteMessageCommand, self).setUp()

        self.command = DeleteMessageCommand()
コード例 #6
0
    def setUp(self):
        super(TestDeleteMessageCommand, self).setUp()

        self.client = client.PushwooshClient()
        self.command = DeleteMessageCommand()