def test_set_twice_same_value(self): """Can set -D twice: globally and for subcommand if values are the same""" idf.init_cli()( args=['--dry-run', '-DAAA=BBB', '-DCCC=EEE', 'build', '-DAAA=BBB', '-DCCC=EEE'], standalone_mode=False, )
def test_set_twice_different_values(self): """Cannot set -D twice: for command and subcommand of idf.py (with different values)""" with self.assertRaises(idf.FatalError): idf.init_cli()( args=['--dry-run', '-DAAA=BBB', 'build', '-DAAA=EEE', '-DCCC=EEE'], standalone_mode=False, )
def test_complex_case(self): result = idf.init_cli()( args=[ '--dry-run', 'clean', 'monitor', 'clean', 'fullclean', 'flash' ], standalone_mode=False, ) self.assertEqual(['fullclean', 'clean', 'flash', 'monitor'], list(result.keys()))
def test_dupplicated_commands_warning(self): capturedOutput = StringIO() sys.stdout = capturedOutput idf.init_cli()( args=['--dry-run', 'clean', 'monitor', 'build', 'clean', 'fullclean', 'all'], standalone_mode=False, ) sys.stdout = sys.__stdout__ self.assertIn('WARNING: Commands "all", "clean" are found in the list of commands more than once.', capturedOutput.getvalue()) sys.stdout = capturedOutput idf.init_cli()( args=['--dry-run', 'clean', 'clean'], standalone_mode=False, ) sys.stdout = sys.__stdout__ self.assertIn('WARNING: Command "clean" is found in the list of commands more than once.', capturedOutput.getvalue())
def test_order_only_dependencies(self): result = idf.init_cli()( args=['--dry-run', 'build', 'fullclean', 'all'], standalone_mode=False, ) self.assertEqual(['fullclean', 'all'], list(result.keys()))
def test_dependencies(self): result = idf.init_cli()( args=['--dry-run', 'flash'], standalone_mode=False, ) self.assertEqual(['flash'], list(result.keys()))
def test_repeated_dependencies(self): result = idf.init_cli()( args=['--dry-run', 'fullclean', 'app', 'fullclean', 'fullclean'], standalone_mode=False, ) self.assertEqual(['fullclean', 'app'], list(result.keys()))