def test_other_uri(self): self.assertEqual(fully_qualify_hadoop_path('foo://bar/baz'), 'foo://bar/baz')
def test_s3n_uri(self): self.assertEqual(fully_qualify_hadoop_path('s3n://bucket/oh/noes'), 's3n://bucket/oh/noes')
def test_hdfs_uri(self): self.assertEqual(fully_qualify_hadoop_path('hdfs://host/path/'), 'hdfs://host/path/')
def test_absolute_path(self): self.assertEqual(fully_qualify_hadoop_path('/path/to/cheese'), 'hdfs:///path/to/cheese')
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')
def test_empty(self): with patch('getpass.getuser') as getuser: getuser.return_value = 'dave' self.assertEqual(fully_qualify_hadoop_path(''), 'hdfs:///user/dave/')