Esempio n. 1
0
    def test_delete_success(self):
        registration = Registration()
        registration._get_param = Mock(side_effect=self.generate_valid_params)
        registration.post('foo')
        response, response_code = registration.delete('foo', '10.10.10.10')

        assert response_code == 200
        assert response == {}
Esempio n. 2
0
    def test_delete_nonexistent_missing_ip_address(self):
        registration = Registration()
        response, response_code = registration.delete('foo', None)

        assert response_code == 400
        assert response == {}
Esempio n. 3
0
    def test_delete_invalid_ip_address(self):
        registration = Registration()
        response, response_code = registration.delete('foo', 'bar')

        assert response_code == 400
        assert response == {}
Esempio n. 4
0
    def test_delete_nonexistent_host(self):
        registration = Registration()
        response, response_code = registration.delete('foo', '1.1.1.1')

        assert response_code == 400
        assert response == {}