コード例 #1
0
ファイル: test_protoc.py プロジェクト: yihanzhen/artman
def test_list_files_recursive():
    expected = [
        'test/fake-repos/fake-proto/excluded/excluded.proto',
        'test/fake-repos/fake-proto/fake.pb.go',
        'test/fake-repos/fake-proto/fake.proto',
    ]
    path = 'test/fake-repos/fake-proto'
    assert sorted(list(protoc_utils.list_files_recursive(path))) == expected
コード例 #2
0
ファイル: test_protoc.py プロジェクト: Landrito/artman
def test_list_files_recursive():
    expected = [
        'test/fake-repos/fake-proto/fake.pb.go',
        'test/fake-repos/fake-proto/fake.proto',
        'test/fake-repos/fake-proto/excluded/excluded.proto',
    ]
    path = 'test/fake-repos/fake-proto'
    assert list(protoc_utils.list_files_recursive(path)) == expected
コード例 #3
0
 def execute(self, grpc_code_dir):
     for filename in protoc_utils.list_files_recursive(grpc_code_dir):
         if filename.endswith('GrpcClient.php'):
             logger.info('Performing replacements in: %s' % (filename,))
             with io.open(filename, encoding='UTF-8') as f:
                 contents = f.read()
             contents = protoc_utils.php_proto_rename(contents)
             with io.open(filename, 'w', encoding='UTF-8') as f:
                 f.write(contents)
コード例 #4
0
 def execute(self, grpc_code_dir):
     for filename in protoc_utils.list_files_recursive(grpc_code_dir):
         if filename.endswith('GrpcClient.php'):
             logger.info('Performing replacements in: %s' % (filename, ))
             with io.open(filename, encoding='UTF-8') as f:
                 contents = f.read()
             contents = protoc_utils.php_proto_rename(contents)
             with io.open(filename, 'w', encoding='UTF-8') as f:
                 f.write(contents)