Browse Source

Fixing merge conflict

Inyoung 8 years ago
parent
commit
d8bdc14335
4 changed files with 42 additions and 2 deletions
  1. BIN
      __pycache__/app.cpython-35.pyc
  2. 29 0
      appunittest.py
  3. 12 1
      appunittest2.py
  4. 1 1
      itemlist.txt

BIN
__pycache__/app.cpython-35.pyc


+ 29 - 0
appunittest.py

@@ -0,0 +1,29 @@
+# File Name: appunittest.py
+# Date: March 3, 2017
+# Description: This class is for testing write file and read file in app.py
+__author__ = "Inyoung Choung"
+
+import os
+from os import path
+import unittest
+import app
+
+# testing file IO
+class writefiletest(unittest.TestCase):
+    def runTest(self):
+        # set path
+        filepath = "C:\In-young Choung\Computer Programming\Self Programming Files\grocerycalc\pytest.txt"
+
+        # create a file and write "pythontest"
+        app.writefile(filepath, "pythontest")
+
+        # read the file that is just created
+        app.readfile(filepath)
+
+        # check if the file is correctly created in the path
+        self.assertTrue(str(path.isfile("pytest.txt")))
+
+# class starter
+if __name__ == '__main__':
+    unittest.main()
+

+ 12 - 1
appunittest2.py

@@ -22,10 +22,21 @@ class testShowError(unittest.TestCase):
         # pass the predefined message into alert_message function.
         result = Impl.display_message(self, message)
 
+import app
+
+# testing Show Error function
+class testShowError(unittest.TestCase):
+    def runTest(self):
+        # initialize value to message variable.
+        message = str("Here is a warning message.")
+
+        # pass the predefined message into alert_message function.
+        result = app.alert_message(message)
+
         # check if the two values in the parameter are matched.
         self.assertEqual(result, message)
 
-# class starter.
+# class starter
 if __name__ == '__main__':
     unittest.main()
 

+ 1 - 1
itemlist.txt

@@ -1 +1 @@
-Aurora Salad FixinsBoulder CanyonClover Leaf Pink Dream Almond UnsweetenedGloryBee, Organic Raw HoneyGreat Value Light MayonnaiseGreat Value Sockeye Hellmanns Real MayonnaiseHershey's Chipits (milk)Hershey's Chipits (semi sweet)Inari Organic Long Brown RiceInari Organic Whole AlmondsKettle Sea Salt Potato ChipsKool-Aid WatermelonKoreanLangnese Forest HoneyMaple Leaf Boneless BreastsMaple Leaf Boneless ThighsMaxwell House Original RoastMiO WatermelonNatrel Nestea Lemon Iced TeaOasis Exotic Mango JuiceOrganic Raw AlmondsRaminSmart Life Salad TopperTilda Pure Steamed Basmati RiceTim Hortons Fine Grind CoffeemyEggsyourEggs
+Aurora Salad FixinsBoulder CanyonClover Leaf Pink Dream Almond UnsweetenedGloryBee, Organic Raw HoneyGreat Value Light MayonnaiseGreat Value Sockeye Hellmanns Real MayonnaiseHershey's Chipits (milk)Hershey's Chipits (semi sweet)Inari Organic Long Brown RiceInari Organic Whole AlmondsKettle Sea Salt Potato ChipsKool-Aid WatermelonKoreanLangnese Forest HoneyMaple Leaf Boneless BreastsMaple Leaf Boneless ThighsMaxwell House Original RoastMiO WatermelonNatrel Nestea Lemon Iced TeaOasis Exotic Mango JuiceOrganic Raw AlmondsRaminSmart Life Salad TopperTilda Pure Steamed Basmati RiceTim Hortons Fine Grind CoffeemyEggstest1test2yourEggs