def test_di_ctor_traits(self): self.assertEqual(0, di_ctor_traits.main(['../di_ctor_traits.py', '-o', self.output_file, '-l', 'n', 'given/ctors.hpp'])) self.assertEqual(read_file(self.output_file), read_file('then/ctors.hpp'))
def test_di_ctor_traits_no_output(self): self.assertEqual(0, di_ctor_traits.main(['../di_ctor_traits.py', '-o', self.output_file, 'given/default_ctor.hpp'])) self.assertFalse(os.path.exists(self.output_file))
def test_di_ctor_traits_args_fail_none(self): with self.assertRaises(SystemExit): di_ctor_traits.main(['./di_ctor_traits.py'])
def test_di_ctor_traits_args_fail_file_not_found(self): self.assertEqual(0, di_ctor_traits.main(['../di_ctor_traits.py', 'not_found.hpp']))
def test_di_ctor_traits_args_type_error(self): with self.assertRaises(TypeError): di_ctor_traits.main()