From 803fd48cf383636585877a4d93652e4f8995a39f Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Thu, 10 Sep 2020 13:06:12 +0530 Subject: removing hardcoded values testing updated github workflow --- tests/removeSample.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/removeSample.py (limited to 'tests/removeSample.py') 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 -- cgit v1.2.3