Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 6fb791c

Browse files
author
Brad Miller
committed
Test non autograded sql too
1 parent 38830b2 commit 6fb791c

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

runestone/activecode/test/_sources/index.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,7 @@ Support for SQL in the browser ? Yes!
13061306

13071307
.. activecode:: sql1
13081308
:language: sql
1309+
:autograde: unittest
13091310
:dburl: /_static/test.db
13101311

13111312
select * from test;
@@ -1315,4 +1316,12 @@ Support for SQL in the browser ? Yes!
13151316
assert 0,1 == hello
13161317
assert 2,1 == 42
13171318

1318-
.. :dburl: http://dev.runestoneinteractive.org:8080/_static/bikeshare.db
1319+
.. :dburl: http://dev.runestoneinteractive.org:8080/_static/bikeshare.db
1320+
1321+
1322+
.. activecode:: sql2
1323+
:language: sql
1324+
:autograde: unittest
1325+
:dburl: /_static/test.db
1326+
1327+
select * from test;

runestone/activecode/test/test_activecode.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ def test_sql_activecode(self):
116116
out = self.driver.find_element_by_id("sql1_stdout")
117117
self.assertTrue('You passed 2 out of 3 tests' in out.text)
118118

119+
t2 = self.driver.find_element_by_id("sql2")
120+
self.assertIsNotNone(t2)
121+
time.sleep(1)
122+
rb = t2.find_element_by_class_name("run-button")
123+
self.assertIsNotNone(rb)
124+
rb.click()
125+
out = self.driver.find_element_by_id("sql2_stdout")
126+
self.assertEqual('',out.text.strip())
127+
119128

120129
def test_readfiles(self):
121130
self.driver.get(self.host + "/skulptfeatures.html")

0 commit comments

Comments
 (0)