def test__packaging__main__sdist(self): os.environ['PACKAGE_TYPES'] = 'sdist' self.write_config_files(working_config) build_python_main() print(os.listdir('artifacts/packages')) self.assertTrue( os.path.exists('artifacts/packages/mypyvalidator-0.0.0.tar.gz'))
def test__packaging__main__wheel(self): os.environ['PACKAGE_TYPES'] = 'wheel' self.write_config_files(working_config) build_python_main() print(os.listdir('artifacts/packages')) self.assertTrue( os.path.exists( 'artifacts/packages/mypyvalidator-0.0.0-py3-none-any.whl'))
def test__publish__sdist__fails_user_secret(self): os.environ['PUBLISH_PYTHON_FAIL_MISSING_CRED'] = 'True' os.environ['PACKAGE_TYPES'] = 'sdist' os.environ['PUBLISH_PYTHON_TIMEOUT'] = "0" self.write_config_files(working_config) build_python_main() self.assertTrue( os.path.exists('artifacts/packages/mypyvalidator-0.0.0.tar.gz')) rc = publish_python_main(twine_command=self.moc_twine_command(rc=999)) self.assertEqual(rc, 1)
def test__publish__sdist__test_pypi(self): os.environ['PUBLISH_PYTHON_FAIL_MISSING_CRED'] = 'True' os.environ['TEST_PYPI_USER'] = '******' os.environ['TEST_PYPI_PASSWORD'] = '******' os.environ['PACKAGE_TYPES'] = 'sdist' os.environ['TWINE_REPOSITORY_URL'] = 'https://test.pypi.org/legacy/' os.environ['PUBLISH_PYTHON_TIMEOUT'] = "0" self.write_config_files(working_config) build_python_main() self.assertTrue( os.path.exists('artifacts/packages/mypyvalidator-0.0.0.tar.gz')) rc = publish_python_main(twine_command=self.moc_twine_command(rc=0)) self.assertEqual(rc, 0)