aboutsummaryrefslogtreecommitdiff
path: root/tests/removeSample.py
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-09-10 13:06:12 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-09-10 13:06:12 +0530
commit803fd48cf383636585877a4d93652e4f8995a39f (patch)
tree1be5bce5f40b66c31f43feb3bec4fffa34c9366a /tests/removeSample.py
parentf5de8ddbfc69e0e958310f90d899c878c550ecd2 (diff)
removing hardcoded values
testing updated github workflow
Diffstat (limited to 'tests/removeSample.py')
-rw-r--r--tests/removeSample.py20
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