Exemplo n.º 1
0
    def test_success_put_file(self):
        with mock.patch.object(subject, 'makeSingleHttpRequest') as p:
            class FakeResp:
                status_code = 200

                def raise_for_status(self):
                    pass

            p.return_value = FakeResp()
            subject.putFile('setup.py', 'http://www.example.com', 'text/plain')
            p.assert_called_once_with('put', 'http://www.example.com', mock.ANY, mock.ANY, mock.ANY)
Exemplo n.º 2
0
    def test_success_put_file(self):
        with mock.patch.object(subject, 'makeSingleHttpRequest') as p:
            class FakeResp:
                status_code = 200

                def raise_for_status(self):
                    pass

            p.return_value = FakeResp()
            subject.putFile('setup.py', 'http://www.example.com', 'text/plain')
            p.assert_called_once_with('put', 'http://www.example.com', mock.ANY, mock.ANY, mock.ANY)
Exemplo n.º 3
0
def test_success_put_file():
    with mock.patch.object(subject, 'makeSingleHttpRequest') as p:

        class FakeResp:
            status_code = 200

            def raise_for_status(*args):
                pass

        p.return_value = FakeResp()
        path = os.path.join(os.path.dirname(os.path.dirname(__file__)),
                            'setup.py')
        subject.putFile(path, 'http://www.example.com', 'text/plain')
        p.assert_called_once_with('put', 'http://www.example.com', mock.ANY,
                                  mock.ANY, mock.ANY)
 def test_success_put_file(self):
     with mock.patch.object(subject, 'makeSingleHttpRequest') as p:
         subject.putFile('setup.py', 'http://www.example.com', 'text/plain')
         p.assert_called_once_with('put', 'http://www.example.com', mock.ANY, mock.ANY, mock.ANY)
Exemplo n.º 5
0
 def test_success_put_file(self):
     with mock.patch.object(subject, 'makeSingleHttpRequest') as p:
         subject.putFile('setup.py', 'http://www.example.com', 'text/plain')
         p.assert_called_once_with('put', 'http://www.example.com',
                                   mock.ANY, mock.ANY)