コード例 #1
0
ファイル: test_cli.py プロジェクト: b-jazz/caniusepython3
 def test_cli_for_metadata(self):
     with tempfile.NamedTemporaryFile('w') as file:
         file.write(EXAMPLE_METADATA)
         file.flush()
         args = ['--metadata', file.name]
         got = ciu_main.projects_from_cli(args)
     self.assertEqual(set(got), self.expected_metadata)
コード例 #2
0
ファイル: test_cli.py プロジェクト: b-jazz/caniusepython3
 def test_cli_for_requirements(self):
     with tempfile.NamedTemporaryFile('w') as file:
         file.write(EXAMPLE_REQUIREMENTS)
         file.flush()
         args = ['--requirements', file.name]
         got = ciu_main.projects_from_cli(args)
     self.assertEqual(set(got), self.expected_requirements)
コード例 #3
0
 def test_cli_for_metadata(self):
     with tempfile.NamedTemporaryFile('w') as file:
         file.write(EXAMPLE_METADATA)
         file.flush()
         args = ['--metadata', file.name]
         got = ciu_main.projects_from_cli(args)
     self.assertEqual(set(got), self.expected_metadata)
コード例 #4
0
 def test_cli_for_requirements(self):
     with tempfile.NamedTemporaryFile('w') as file:
         file.write(EXAMPLE_REQUIREMENTS)
         file.flush()
         args = ['--requirements', file.name]
         got = ciu_main.projects_from_cli(args)
     self.assertEqual(set(got), self.expected_requirements)
コード例 #5
0
 def test_excluding_requirements(self):
     with tempfile.NamedTemporaryFile('w') as file:
         file.write(EXAMPLE_REQUIREMENTS)
         file.flush()
         args = ['--requirements', file.name, '--exclude', 'pickything']
         got = ciu_main.projects_from_cli(args)
     expected_requirements = set(self.expected_requirements)
     expected_requirements.remove('pickything')
     self.assertNotIn('pickything', set(got))
     self.assertEqual(set(got), expected_requirements)
コード例 #6
0
ファイル: test_cli.py プロジェクト: b-jazz/caniusepython3
 def test_projects_must_be_specified(self, parser_error):
     ciu_main.projects_from_cli([])
     self.assertEqual(
         mock.call("Missing 'requirements', 'metadata', or 'projects'"),
         parser_error.call_args)
コード例 #7
0
ファイル: test_cli.py プロジェクト: b-jazz/caniusepython3
 def test_cli_for_projects(self):
     args = ['--projects', 'foo,bar']
     got = ciu_main.projects_from_cli(args)
     self.assertEqual(set(got), frozenset(['foo', 'bar']))
コード例 #8
0
 def test_verbose_output(self):
     ciu_main.projects_from_cli(['-v', '-p', 'ipython'])
     self.assertTrue(logging.getLogger('ciu').isEnabledFor(logging.INFO))
コード例 #9
0
 def test_projects_must_be_specified(self, parser_error):
     ciu_main.projects_from_cli([])
     self.assertEqual(
         mock.call("Missing 'requirements', 'metadata', or 'projects'"),
         parser_error.call_args)
コード例 #10
0
 def test_cli_for_projects(self):
     args = ['--projects', 'foo', 'bar']
     got = ciu_main.projects_from_cli(args)
     self.assertEqual(set(got), frozenset(['foo', 'bar']))
コード例 #11
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_verbose_output(self):
     ciu_main.projects_from_cli(['-v', '-p', 'ipython'])
     self.assertTrue(logging.getLogger('ciu').isEnabledFor(logging.INFO))