Exemple #1
0
 def test_other_uri(self):
     self.assertEqual(fully_qualify_hadoop_path('foo://bar/baz'),
                      'foo://bar/baz')
Exemple #2
0
 def test_s3n_uri(self):
     self.assertEqual(fully_qualify_hadoop_path('s3n://bucket/oh/noes'),
                      's3n://bucket/oh/noes')
Exemple #3
0
 def test_hdfs_uri(self):
     self.assertEqual(fully_qualify_hadoop_path('hdfs://host/path/'),
                      'hdfs://host/path/')
Exemple #4
0
 def test_absolute_path(self):
     self.assertEqual(fully_qualify_hadoop_path('/path/to/cheese'),
                      'hdfs:///path/to/cheese')
Exemple #5
0
 def test_relative_path(self):
     with patch('getpass.getuser') as getuser:
         getuser.return_value = 'dave'
         self.assertEqual(fully_qualify_hadoop_path('path/to/chocolate'),
                          'hdfs:///user/dave/path/to/chocolate')
Exemple #6
0
 def test_empty(self):
     with patch('getpass.getuser') as getuser:
         getuser.return_value = 'dave'
         self.assertEqual(fully_qualify_hadoop_path(''), 'hdfs:///user/dave/')