import unittest
import database
import EScavange
import gameMaker

class TestDatabaseCreation(unittest.TestCase):
  def setUp(self):
    self.db = database.Database()
    self.gameMaker = gameMaker.GameMaker()
  
  def accessDB(self):
    pass
    #stub for now : check that we can access the database
 
class TestMain(unittest.TestCase):
  def setUp(self):
    self.db = database.Database()
    self.inputs = escavange.Main()
    self.inputs.user = "Bob"            #Set the user inputs
    self.inputs.password = "password"
    
  def testPrompt(self):
    self.assertEquals(escavange.Main(), "Welcome to EScavange! Please log in: ", "Main function does not print expected value")

  def testLoginNoTeams(self):
    self.assertEquals(escavange.login(), "There is no such user. Please create a new team", "Login did not give the correct error message")

  def testLoginTeam(self):
    self.db.addTeam(user,password) #90% sure this is wrong
    self.assertEquals(escavange.login(), "Currently logged in as Bob", "Login was not with the correct user")
    
  def testLoginMaster(self):
    self.inputs.user = "maker"
    self.inputs.password = "wrongpassword"
    self.assertEquals(escavange.login(), "Failed to log in as Master", "Was able to log in as master and should not have been able to")
    
  def testLoginMaster(self):
    self.inputs.user = "maker"
    self.inputs.password = "password"
    self.assertEquals(escavange.login(), "Logged in as Master", "Was NOT able to log in as master and should have been able to")
  
suite = unittest.TestSuite()

suite.addTest(unittest.makeSuite(TestDatabaseCreation))
suite.addTest(unittest.makeSuite(TestMain))

runner = unittest.TextTestRunner()
res=runner.run(suite)
print(res)
print("*"*20)
for i in res.failures: print(i[1])

@@ -99,32 +99,174 @@
 test.TestCase):%0A
+  #Test that we can access the database. Should not test that the database DS is correct, that should be%0A  #covered by the database tests.%0A  %0A
   def setUp(self
@@ -438,17 +438,72 @@
 tabase%0A 
-%0A
+   # How do i verify that the database is open???%0A    %0A 
 class Te
@@ -504,18 +504,19 @@
 ass Test
-Ma
+Log
 in(unitt
@@ -530,16 +530,129 @@
 tCase):%0A
+  #Test log in functionality. Will determine if username belongs to gamemaker or team and call correct method%0A  %0A
   def se
@@ -795,204 +795,111 @@
 puts
-%0A    self.inputs.password = %22password%22%0A    %0A  def testPrompt(self):%0A    self.assertEquals(escavange.Main(), %22Welcome to EScavange! Please log in: %22, %22Main function does not print expected value%22)%0A
+ (so the test can be automatic, no user input necessary)%0A    self.inputs.password = %22password%22%0A        
 %0A  d
@@ -1133,30 +1133,59 @@
 d) #
-90%25 sure this is wrong
+What is the syntax to add a team to the DB?????????
 %0A   
@@ -1591,32 +1591,90 @@
 s.user = %22maker%22
+        #is this what we decided for username and password
 %0A    self.inputs
@@ -1749,32 +1749,95 @@
 ged in as Master
+. What would you like to do? %5Badd-team, add-landmark, add-game%5D
 %22, %22Was NOT able
@@ -1888,16 +1888,982 @@
 le to%22)%0A
+ %0Aclass TestMain(unittest.TestCase):%0A  #Test prompts and functionality of main script%0A  %0A  def setUp(self):%0A    self.db = database.Database()%0A    self.inputs = escavange.Main()%0A   %0A  def testPromptLogin(self):%0A    self.assertEquals(escavange.Main(), %22Welcome to EScavange! Please log in: %22, %22Main function does not print expected value%22)%0A    %0A  def testPromptAsGameMaker(self):%0A    # Should I continue with this? Should I move game maker & team to another class? :( %0A    self.inputs.user = %22maker%22%0A    self.inputs.password = %22password%22%0A    escavange.login()%0A    %0A    self.assertEquals(self.inputs.cmd = %22add-team%22, %22You chose to add a team. Please enter the username: %22, %22add-team does not work%22);%0A    self.assertEquals(self.inputs.cmd = %22team%22, %22Please enter the password for team: %22, %22adding team username did not work%22)%0A    self.assertEquals(self.inputs.cmd = %22password%22, %22You have added team: team with password: password%22, %22adding team password did not work%22);%0A
   %0Asuite
@@ -2987,16 +2987,63 @@
 tMain))%0A
+suite.addTest(unittest.makeSuite(TestLogin))%0A%0A%0A
 %0Arunner 

Update ut_main.py