示例#1
0
    def test_get_namespace_fallback(self):
        project = Project()
        self.assertEqual(project.get_namespace(), 'default')

        project.set_config(
            project_pb2.Project(variables=[
                common_pb2.Variable(name='test_name', value='test_value')
            ]))
        self.assertEqual(project.get_namespace(), 'default')
示例#2
0
    def test_get_namespace_from_variables(self):
        project = Project()
        project.set_config(
            project_pb2.Project(variables=[
                common_pb2.Variable(name='namespace', value='haha')
            ]))

        self.assertEqual(project.get_namespace(), 'haha')