def runThawWithMockArgs(mock_args): with mock.patch('sys.stdout', new=StringIO()) as mock_out: thaw.main() report = mock_out.getvalue() self.assertEqual( report.strip(), "--library and --imports flags cannot be used in the same report. Instead, please run thaw with one flag and then rerun with the other." )
def runThawWithMockArgs(mock_out): with mock.patch('sys.stdout', new=StringIO()) as mock_out: thaw.main() report = mock_out.getvalue() self.assertEqual( report.strip(), "No requirements file found - please run thaw in the top level of your project" )
def runThawWithMockArgs(mock_args): with mock.patch('sys.stdout', new=StringIO()) as mock_out: thaw.main()
def runThawInTempDirectoryAndReturn(self): temp_path = self.test_dir orig_path = os.getcwd() os.chdir(temp_path) thaw.main() os.chdir(orig_path)
def runningThaw(mock_args): with mock.patch('sys.stdout', new=StringIO()) as mock_out: thaw.main() report = mock_out.getvalue() self.assertTrue('pandas' not in report and 'numpy' in report and 'idna' not in report)
def runThawWithMockArgs(mock_args): with mock.patch('sys.stdout', new=StringIO()) as mock_out: thaw.main() report = mock_out.getvalue() self.assertTrue('1 MAJOR' in report)
def runThawWithMockArgs(mock_args): line_text = 'print(df)' with mock.patch('sys.stdout', new=StringIO()) as mock_out: thaw.main() self.assertTrue(1 == 1) self.assertTrue(line_text in mock_out.getvalue())
def run(): thaw.main()