예제 #1
0
 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."
         )
예제 #2
0
 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"
         )
예제 #3
0
 def runThawWithMockArgs(mock_args):
     with mock.patch('sys.stdout', new=StringIO()) as mock_out:
         thaw.main()
예제 #4
0
 def runThawInTempDirectoryAndReturn(self):
     temp_path = self.test_dir
     orig_path = os.getcwd()
     os.chdir(temp_path)
     thaw.main()
     os.chdir(orig_path)
예제 #5
0
 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)
예제 #6
0
 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)
예제 #7
0
 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())
예제 #8
0
def run():
    thaw.main()