def add_class(self, class_name, attributes, methods, relationships): new_class = ClassBuilder() new_class.build_class(class_name, attributes, methods, relationships) self.all_my_classbuilders.append(new_class)
def test_02(self): tester = ClassBuilder() tester.build_class("ClassName", ["attribute1: string", "attribute2: int"], ["Method1(input):integer"], ("extends", "Class2")) assert len(tester.all_my_attributes) is 2
def test_01(self): tester = ClassBuilder() tester.build_class("Name", ["attribute1: string"], ["Method1(input):integer"], ("extends", "Class2")) assert tester.name is "Name"
def test_03(self): x = ClassBuilder() x.build_class("ClassName", ["attribute1: string"], ["Method1(input):integer", "Method2(str):hello"], ("extends", "Class2")) assert len(x.all_my_methods) is 2
def test_04(self): x = ClassBuilder() x.build_class("ClassName", ["attribute1: string"], ["Method1(input):integer"], ("comp", "Class2")) assert len(x.relationships) > 0
def test_01(self): x = ClassBuilder() x.build_class("ClassName", ["attribute1: string"], ["Method1(input):integer"], ("extends", "Class2")) assert x.name is "ClassName"
def add_class(self, args): new_class = ClassBuilder() new_class.build_class(args) self.all_my_classbuilders.append(new_class)
def add_class(cls, args): new_class = ClassBuilder() new_class.build_class(args) return new_class