Skip to content

Commit

Permalink
[test project] Adapt code to produce more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Sep 27, 2024
1 parent d6406c3 commit ebcd412
Showing 1 changed file with 34 additions and 43 deletions.
77 changes: 34 additions & 43 deletions resources/examples/project1/root2/moduleInRootPackage2.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,48 +43,14 @@ def print_info(self):
p1 = Employee("John", 36)
p1.print_info()

class Employee2:
from root import rootPackageVariable
from moduleAtRoot import moduleAtRootVariable
from moduleAtRoot2 import Person
from moduleAtRoot import sort_list
from root.subpackage1.subsubpackage1 import Room
from root.subpackage1.subsubpackage1 import return2

print(rootPackageVariable)
print(moduleAtRootVariable)

p1 = Person("Imen", 37)
p1.printInfos()

x = ["a", "b", "c", "d", "e", "f", "g", "h", "i"]
y = [0, 1, 1, 0, 1, 2, 2, 0, 1]

print(sort_list(x, y))

# create object of Room class
study_room = Room()
# assign values to all the properties
study_room.length = 42.5
study_room.breadth = 30.8
# access method inside class
study_room.calculate_area()

print(return2())
class Employee2:

def __init__(self, name, age):
self.name = name
self.age = age

def print_info(self):
print(self.name + " " + str(self.age))


p2 = Employee2("John", 36)
p2.print_info()

def functionWithImportsInRoot2():
class Employee3:
def print_info_2(self):
from root import rootPackageVariable
from moduleAtRoot import moduleAtRootVariable
from moduleAtRoot2 import Person
Expand Down Expand Up @@ -112,13 +78,38 @@ class Employee3:
study_room.calculate_area()

print(return2())
print(self.name + " " + str(self.age))

def __init__(self, name, age):
self.name = name
self.age = age

def print_info(self):
print(self.name + " " + str(self.age))
p2 = Employee2("John", 36)
p2.print_info_2()


p3 = Employee("John", 36)
p3.print_info()
def functionWithImportsInRoot2():
from root import rootPackageVariable
from moduleAtRoot import moduleAtRootVariable
from moduleAtRoot2 import Person
from moduleAtRoot import sort_list
from root.subpackage1.subsubpackage1 import Room
from root.subpackage1.subsubpackage1 import return2

print(rootPackageVariable)
print(moduleAtRootVariable)

p1 = Person("Imen", 37)
p1.printInfos()

x = ["a", "b", "c", "d", "e", "f", "g", "h", "i"]
y = [0, 1, 1, 0, 1, 2, 2, 0, 1]

print(sort_list(x, y))

# create object of Room class
study_room = Room()
# assign values to all the properties
study_room.length = 42.5
study_room.breadth = 30.8
# access method inside class
study_room.calculate_area()

print(return2())

0 comments on commit ebcd412

Please sign in to comment.