diff options
Diffstat (limited to 'tests/removeSample.py')
-rw-r--r-- | tests/removeSample.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/removeSample.py b/tests/removeSample.py new file mode 100644 index 0000000..d054f60 --- /dev/null +++ b/tests/removeSample.py @@ -0,0 +1,20 @@ +import mysql.connector as con +import configparser +config = configparser.ConfigParser() +config.read('config.ini') + +try: + config['DATABASE'] +except KeyError: + config.read("../config.ini") + +mycon = con.connect(host=config['DATABASE']['HOST'],user=config['DATABASE']['USER'],password=config['DATABASE']['PASSWORD'],port=config['DATABASE']['PORT'],database=config['DATABASE']['NAME']) +mycursor = mycon.cursor() + +print("Removing Test Query") +jobID = "l9xo2isr98oepcia" +q = 'delete from curieweb where id="%s"' % (jobID) +mycursor.execute(q) +mycon.commit() + +print("Database working perfectly")
\ No newline at end of file |