import os
import configparser
import shutil
import subprocess

# Setup
print("Setting up...")
shutil.copyfile("../halite.ini", "temp.ini")
shutil.copyfile("tests.ini", "../halite.ini")
parser = configparser.ConfigParser()
parser.read("../halite.ini")

# Website tests
print("Beginning website backend tests")
os.system("mysql -u "+parser["database"]["username"]+" -p"+parser["database"]["password"]+" < ../website/sql/Database.sql")
subprocess.call(["phpunit", "--stderr", "website/"])

# Environment tests.
print(subprocess.Popen('cd environment; python3 testenv.py', stdout=subprocess.PIPE, shell = True).stdout.read().decode('utf-8'))

# Tear down
print("Almost done...")
shutil.copyfile("temp.ini", "../halite.ini")

@@ -3,16 +3,31 @@
 port os%0A
+import os.path%0A
 import c
@@ -38,16 +38,16 @@
 gparser%0A
-
 import s
@@ -98,24 +98,64 @@
 ing up...%22)%0A
+if os.path.isfile(%22../halite.ini%22):%0A    
 shutil.copyf
@@ -187,16 +187,17 @@
 p.ini%22)%0A
+%0A
 shutil.c
@@ -724,16 +724,54 @@
 ne...%22)%0A
+if os.path.isfile(%22../temp.ini%22):%0A    
 shutil.c

Fix runTests.py for travis