diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-04 19:32:42 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-04 19:32:42 +0100 |
commit | 7804cdf8ecbc2bb40231199669444665df597eb6 (patch) | |
tree | 965801ee94a1113494fe9f0d414eb5d60d205cde /test | |
parent | Support bulk upload to PQ (diff) | |
download | mygrate-7804cdf8ecbc2bb40231199669444665df597eb6.tar.bz2 mygrate-7804cdf8ecbc2bb40231199669444665df597eb6.tar.xz mygrate-7804cdf8ecbc2bb40231199669444665df597eb6.zip |
Support copying exist table data
Diffstat (limited to 'test')
-rw-r--r-- | test/sql/fillTestTable.sql | 2 | ||||
-rw-r--r-- | test/test-e2e.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/test/sql/fillTestTable.sql b/test/sql/fillTestTable.sql new file mode 100644 index 0000000..188107f --- /dev/null +++ b/test/sql/fillTestTable.sql @@ -0,0 +1,2 @@ +INSERT INTO session(session_id, username, user_lvl, ip_addr, port, created, modified) + VALUES('hashyhash', 'testuser', 'groupadm', '10.10.0.1', 2433, now(), now()); diff --git a/test/test-e2e.cpp b/test/test-e2e.cpp index 9906a0b..1921a08 100644 --- a/test/test-e2e.cpp +++ b/test/test-e2e.cpp @@ -6,6 +6,7 @@ #include "testdb-postgresql.h" #include <output/pq/updateDatabase.h> #include <sql/createTestTable.h> +#include <sql/fillTestTable.h> #include <sql/selectTestTable.h> BOOST_AUTO_TEST_CASE(e2e) @@ -25,7 +26,9 @@ BOOST_AUTO_TEST_CASE(e2e) BOOST_REQUIRE(src); MyGrate::sql::createTestTable::execute(&mym); + MyGrate::sql::fillTestTable::execute(&mym); out.addTable(&mym, "session"); + out.copyTableContent(&mym, "session"); - BOOST_CHECK_EQUAL(MyGrate::sql::selectTestTable::execute(&pqm)->rows(), 0); + BOOST_CHECK_EQUAL(MyGrate::sql::selectTestTable::execute(&pqm)->rows(), 1); } |