Esempio n. 1
0
 def test_is_dart_package_dir(self):
     package_dir = os.path.join(self.temp_dir, 'test_package')
     lib_dir = os.path.join(package_dir, 'lib')
     os.makedirs(lib_dir)
     with open(os.path.join(package_dir, 'pubspec.yaml'), 'w') as f:
         f.write('name: test_package\n')
     self.assertTrue(gen_reference_docs.is_dart_package_dir(package_dir))
Esempio n. 2
0
 def test_is_dart_package_dir_missing_lib(self):
     package_dir = os.path.join(self.temp_dir, 'test_package')
     os.mkdir(package_dir)
     self.assertFalse(gen_reference_docs.is_dart_package_dir(package_dir))
Esempio n. 3
0
 def test_is_dart_package_dir_missing_pubspec(self):
     package_dir = os.path.join(self.temp_dir, 'test_package')
     lib_dir = os.path.join(package_dir, 'lib')
     os.makedirs(lib_dir)
     self.assertFalse(gen_reference_docs.is_dart_package_dir(package_dir))
Esempio n. 4
0
 def test_is_dart_package_dir_does_not_exist(self):
     package_dir = os.path.join(self.temp_dir, 'test_package')
     self.assertFalse(gen_reference_docs.is_dart_package_dir(package_dir))