Beispiel #1
0
if __name__ == "__main__":
    import Customers, DataProcessor, Persons
else:
    raise Exception("This file was not created to be imported ")

p1 = Persons.Person("Bob", "Smith", "50")
print(p1)

e1 = Customers.Customer(1, "Sue", "Jones", "49",
                        "1111 Main St  Seattle, Wa 98103", "206 931 6127",
                        "*****@*****.**")
# print(e1)

Customers.CustomerList.AddCustomer(e1)
print(Customers.CustomerList.ToString())
Beispiel #2
0
print("Test the DataProcessor.File class")
objDP = DataProcessor.File()
objDP.FileName = "Test.txt"
objDP.TextData = "This is a test"
strMessage = objDP.SaveData()
print(strMessage)

print("\n Test the DataProcessor.Database class")
try:
    print("Trying to create an object, but the class is not ready")
    objDP = DataProcessor.Database()
except:
    print("This should fail")

print("\n Test the Persons.Person class")
objP = Persons.Person()
objP.FirstName = "Bob"
objP.LastName = "Smith"
print(objP.ToString())

print("\n Test the Employees.Employee class")
objE = Employees.Employee(1, "Bob")
# objE.Id = 1
# objE.FirstName = "Bob"
# objE.LastName = "Smith"
print(objE.ToString())

print("\n Test the Employee.EmployeeList class")
objEL = Employees.EmployeeList()
try:
    print("Trying the wrong object type")
Beispiel #3
0
# !/usr/local/bin/python3
import Persons

person = Persons.Person()
person.FirstName = "James"
person.LastName = "Cameron"
print(person)
print(person.GetObjectCount())

import Customers

customer = Customers.Customer()
customer.Id = 1
customer.FirstName = "Alisha"
customer.LastName = "Banner"
print("This is the Customer Object: ",  customer)

import DataProcessing

file = DataProcessing.DataProcessing()
file.FileName = "Testfile.txt"
file.TextData = "Blah"
file.SaveData()