def test_main_fail_to_parse(self): """main fail.""" stub_request_metadata(badge=True) with self.assertRaises(SystemExit) as exc: commands.main() self.assertEqual(2, exc.exception.code) self.assertTrue(sys.stderr.getvalue())
def setUp(self): """Prepare test data.""" self.cwd = os.getcwd() self.testdir = tempfile.mkdtemp(suffix='-bootstrap-py-test') params = Dummy() setattr(params, 'name', 'foo') setattr(params, 'author', 'Alice') setattr(params, 'email', '*****@*****.**') setattr(params, 'url', 'https://example.org/foo') setattr(params, 'license', 'gplv3') setattr(params, 'outdir', self.testdir) setattr(params, 'with_samples', True) stub_request_metadata() self.pkg_data = package.PackageData(params) self.pkg_tree = package.PackageTree(self.pkg_data)
def setUp(self): """Prepare tests.""" self.metadata = stub_request_metadata() self.parser = argparse.ArgumentParser(description='usage') self.capture = sys.stdout self.capture_error = sys.stderr sys.stdout = six.StringIO() sys.stderr = six.StringIO() self.outdir = tempfile.mkdtemp(suffix='-bootstrap-py-test')
def setUp(self): """Prepare test data.""" self.params = Dummy() setattr(self.params, 'foo', 'hoge') setattr(self.params, 'bar', 'moge') setattr(self.params, 'baz', 'fuga') self.default_params = Dummy() setattr(self.default_params, 'date', '2016-01-29') setattr(self.default_params, 'version', '1.0.0') setattr(self.default_params, 'description', 'dummy description.') self.metadata = stub_request_metadata()
def setUp(self): """Prepare test data.""" self.data = stub_request_metadata()