def test_does_use_custom_pip_import_string(self):
        fake_osutils = FakePopenOSUtils([FakePopen(0, '', '')])
        expected_import_statement = 'foobarbaz'
        pip = SubprocessPip(osutils=fake_osutils,
                            import_string=expected_import_statement)
        pip.main(['--version'])

        pip_execution_string = fake_osutils.popens[0][0][0][2]
        import_statement = pip_execution_string.split(';')[1].strip()
        assert import_statement == expected_import_statement
Ejemplo n.º 2
0
    def test_does_use_custom_pip_import_string(self):
        fake_osutils = FakePopenOSUtils([FakePopen(0, '', '')])
        expected_import_statement = 'foobarbaz'
        pip = SubprocessPip(osutils=fake_osutils,
                            import_string=expected_import_statement)
        pip.main(['--version'])

        pip_execution_string = fake_osutils.popens[0][0][0][2]
        import_statement = pip_execution_string.split(';')[1].strip()
        assert import_statement == expected_import_statement
Ejemplo n.º 3
0
 def test_can_invoke_pip(self):
     pip = SubprocessPip()
     rc, err = pip.main(['--version'])
     # Simple assertion that we can execute pip and it gives us some output
     # and nothing on stderr.
     assert rc == 0
     assert err == b''
Ejemplo n.º 4
0
 def test_can_invoke_pip(self):
     pip = SubprocessPip()
     rc, err = pip.main(['--version'])
     # Simple assertion that we can execute pip and it gives us some output
     # and nothing on stderr.
     assert rc == 0
     assert err == b''
Ejemplo n.º 5
0
 def test_does_error_code_propagate(self):
     pip = SubprocessPip()
     rc, _, err = pip.main(['badcommand'])
     assert rc != 0
     # Don't want to depend on a particular error message from pip since it
     # may change if we pin a differnet version to Chalice at some point.
     # But there should be a non-empty error message of some kind.
     assert err != b''
Ejemplo n.º 6
0
 def test_does_error_code_propagate(self):
     pip = SubprocessPip()
     rc, err = pip.main(['badcommand'])
     assert rc != 0
     # Don't want to depend on a particular error message from pip since it
     # may change if we pin a differnet version to Chalice at some point.
     # But there should be a non-empty error message of some kind.
     assert err != b''