Exemple #1
0
 def test_get_extension_one_pass(self):
     """Test not compressed"""
     file_name = '/Users/aznarsig/Documents/Python/climada_python/data/demo/SC22000_VE__M1.grd'
     self.assertEqual('.grd', get_extension(file_name)[1])
     self.assertEqual(
         '/Users/aznarsig/Documents/Python/climada_python/data/demo/SC22000_VE__M1',
         get_extension(file_name)[0])
Exemple #2
0
 def test_get_extension_two_pass(self):
     """Test compressed"""
     file_name = '/Users/aznarsig/Documents/Python/climada_python' \
                 '/data/demo/SC22000_VE__M1.grd.gz'
     self.assertEqual('.grd.gz', get_extension(file_name)[1])
     self.assertEqual(
         str(
             Path(
                 '/Users/aznarsig/Documents/Python/climada_python/data/demo/SC22000_VE__M1'
             )),
         get_extension(file_name)[0])
 def test_get_extension_no_pass(self):
     """Test no extension """
     file_name = '/Users/aznarsig/Documents/Python/climada_python/data/demo/SC22000_VE__M1'
     self.assertEqual('', get_extension(file_name)[1])
     self.assertEqual(file_name, get_extension(file_name)[0])