示例#1
0
 def test_name_from_dir(self):
     """Charm name equals dir name if no metadata.yaml exists"""
     self.assertEqual(
         get_charm_name(self.dir_), os.path.basename(self.dir_))
示例#2
0
 def test_name_from_dir(self):
     """Charm name equals dir name if no metadata.yaml exists"""
     self.assertEqual(get_charm_name(self.dir_),
                      os.path.basename(self.dir_))
示例#3
0
    def test_name_from_yaml(self):
        """Charm name pulled from metadata.yaml if it exists"""
        with open(os.path.join(self.dir_, 'metadata.yaml'), 'w') as f:
            f.write('name: testcharm')

        self.assertEqual(get_charm_name(self.dir_), 'testcharm')
示例#4
0
    def test_name_from_yaml(self):
        """Charm name pulled from metadata.yaml if it exists"""
        with open(os.path.join(self.dir_, 'metadata.yaml'), 'w') as f:
            f.write('name: testcharm')

        self.assertEqual(get_charm_name(self.dir_), 'testcharm')