Exemple #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)
    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)
Exemple #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)
Exemple #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)