예제 #1
0
    def setUp(self):
        self.config = Config()
        self.config.reset_configuration()
        compilers = self.config.get_thrift_option("compilers")
        if compilers is None or len(compilers) == 0:
            self.helper = Thrift(None)
        else:
            thrift_compiler = ThriftCompiler(compilers[0])
            self.helper = Thrift(thrift_compiler)

        project_path = os.path.join(
            os.path.dirname(
                os.path.abspath(inspect.getfile(inspect.currentframe()))),
            "../")
        project_path = os.path.realpath(project_path)
        self.config.repo_dir = project_path
예제 #2
0
파일: client.py 프로젝트: safaci2000/medusa
 def __init__(self, services, thrift_compiler):
     self.compiler = thrift_compiler
     self.config = Config()
     self.sandbox_work = self.config.work_dir
     self.status = Status()
     self.thrift_helper = Thrift(self.compiler)
     self.log = Log(log_file="status.log", logger_name="status").log
     self.services = services
예제 #3
0
 def test_special_case_object_name(self):
     th = Thrift(None)
     src = "/home/user/foobar/blah/wizecommerce.services.sellerprogramrecord.thrift"
     result = th.get_object_name(src)
     expected = "sellerprogramrecord-client"
     self.failUnlessEqual(expected, result)
예제 #4
0
 def test_complex_object_name(self):
     th = Thrift(None)
     src = "/home/user/foobar/blah/wizecommerce.bizobj.search.foobar.sellerprogramrecord.thrift"
     result = th.get_object_name(src)
     expected = "search-foobar-sellerprogramrecord-bizobj"
     self.failUnlessEqual(expected, result)