Ubuntu Pastebin

Paste from mardy at Fri, 27 May 2016 15:36:33 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
=== modified file 'signon-plugin/tests/test_plugin.cpp'
--- signon-plugin/tests/test_plugin.cpp 2016-05-24 20:57:27 +0000
+++ signon-plugin/tests/test_plugin.cpp 2016-05-27 15:34:27 +0000
@@ -28,6 +28,7 @@
 
 #include <SignOn/uisessiondata_priv.h>
 
+#include "token.h"
 #include "ubuntuone-plugin.h"
 
 using namespace SignOn;
@@ -249,10 +250,28 @@
         sessionData.toMap() <<
         -1 <<
         false << response.toMap() << stored.toMap();
+
     sessionData = UbuntuOne::PluginData();
+    QString tokenName = UbuntuOne::Token::buildTokenName();
+    sessionData.setStoredData(QVariantMap {
+        { tokenName, QVariantMap {
+            { "ConsumerKey", "ck" },
+            { "ConsumerSecret", "cs" },
+            { "TokenKey", "tk" },
+            { "TokenSecret", "ts" },
+        }},
+    });
     response = UbuntuOne::PluginData();
+    response.setConsumerKey("ck");
+    response.setConsumerSecret("cs");
+    response.setTokenKey("tk");
+    response.setTokenSecret("ts");
     stored = UbuntuOne::PluginData();
     storedData.clear();
+    QTest::newRow("stored, valid") <<
+        sessionData.toMap() <<
+        -1 <<
+        false << response.toMap() << stored.toMap();
 }
 
 void PluginTest::testStoredToken()
Download as text