aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2017-02-02 23:54:09 -0800
committerRyan Huber <rhuber@gmail.com>2017-02-02 23:54:09 -0800
commitbc4777310a0e695a8993964bec89f7b5bafd5ad4 (patch)
tree0b72c1e8e9cd2b9492c7feff6834533f3fed7288 /_pytest
parent6c48a07fc9a9a858fb5e0e6042053b1323ba2078 (diff)
downloadwee-slack-bc4777310a0e695a8993964bec89f7b5bafd5ad4.tar.gz
more tests
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/conftest.py8
-rw-r--r--_pytest/test_slackchannel.py20
-rw-r--r--_pytest/test_slackdmchannel.py20
-rw-r--r--_pytest/test_slackgroupchannel.py20
-rw-r--r--_pytest/test_slackmpdmchannel.py20
5 files changed, 88 insertions, 0 deletions
diff --git a/_pytest/conftest.py b/_pytest/conftest.py
index 07dfc5e..8fcaf77 100644
--- a/_pytest/conftest.py
+++ b/_pytest/conftest.py
@@ -32,6 +32,14 @@ def realish_eventrouter():
rtmstartdata = open('_pytest/data/http/rtm.start.json', 'r').read()
e.receive_httprequest_callback(context, 1, 0, rtmstartdata, 4)
e.handle_next()
+ #e.sc is just shortcuts to these items
+ e.sc = {}
+ e.sc["team_id"] = e.teams.keys()[0]
+ e.sc["team"] = e.teams[e.sc["team_id"]]
+ e.sc["user"] = e.teams[e.sc["team_id"]].users[e.teams[e.sc["team_id"]].users.keys()[0]]
+ socket = mock_websocket
+ e.teams[e.sc["team_id"]].ws = socket
+
return e
diff --git a/_pytest/test_slackchannel.py b/_pytest/test_slackchannel.py
new file mode 100644
index 0000000..5f04d69
--- /dev/null
+++ b/_pytest/test_slackchannel.py
@@ -0,0 +1,20 @@
+from mock import Mock
+#from wee_slack import SlackChannel
+
+def test_SlackChannel(realish_eventrouter):
+ e = realish_eventrouter
+
+ print e.sc["team"].channels
+ #c = SlackChannel(e, **json.loads(chan))
+ c = e.sc["team"].channels['C3ZEQAYN7']
+
+ print c.formatted_name()
+ c.is_someone_typing = Mock(return_value=True)
+ c.channel_buffer = Mock(return_value=True)
+ print c.create_buffer()
+ print c.rename()
+ print c.current_short_name
+ print c.formatted_name()
+ print c.rename()
+ print c.formatted_name()
+# assert False
diff --git a/_pytest/test_slackdmchannel.py b/_pytest/test_slackdmchannel.py
new file mode 100644
index 0000000..203c4ae
--- /dev/null
+++ b/_pytest/test_slackdmchannel.py
@@ -0,0 +1,20 @@
+from mock import Mock
+#from wee_slack import SlackChannel
+
+def test_SlackDMChannel(realish_eventrouter):
+ e = realish_eventrouter
+
+ print e.sc["team"].channels
+ #c = SlackChannel(e, **json.loads(chan))
+ c = e.sc["team"].channels['D3ZEQULHZ']
+
+ print c.formatted_name()
+ c.is_someone_typing = Mock(return_value=True)
+ c.channel_buffer = Mock(return_value=True)
+ print c.create_buffer()
+ print c.rename()
+ print c.current_short_name
+ print c.formatted_name()
+ print c.rename()
+ print c.formatted_name()
+# assert False
diff --git a/_pytest/test_slackgroupchannel.py b/_pytest/test_slackgroupchannel.py
new file mode 100644
index 0000000..59793f2
--- /dev/null
+++ b/_pytest/test_slackgroupchannel.py
@@ -0,0 +1,20 @@
+from mock import Mock
+#from wee_slack import SlackChannel
+
+def test_SlackGroupChannel(realish_eventrouter):
+ e = realish_eventrouter
+
+ print e.sc["team"].channels
+ #c = SlackChannel(e, **json.loads(chan))
+ c = e.sc["team"].channels['G3ZJKP7GA']
+
+ print c.formatted_name()
+ c.is_someone_typing = Mock(return_value=True)
+ c.channel_buffer = Mock(return_value=True)
+ print c.create_buffer()
+ print c.rename()
+ print c.current_short_name
+ print c.formatted_name()
+ print c.rename()
+ print c.formatted_name()
+# assert False
diff --git a/_pytest/test_slackmpdmchannel.py b/_pytest/test_slackmpdmchannel.py
new file mode 100644
index 0000000..a2c6c51
--- /dev/null
+++ b/_pytest/test_slackmpdmchannel.py
@@ -0,0 +1,20 @@
+from mock import Mock
+#from wee_slack import SlackChannel
+
+def test_SlackMPDMChannel(realish_eventrouter):
+ e = realish_eventrouter
+
+ print e.sc["team"].channels
+ #c = SlackChannel(e, **json.loads(chan))
+ c = e.sc["team"].channels['G3ZGMF4RZ']
+
+ print c.formatted_name()
+ c.is_someone_typing = Mock(return_value=True)
+ c.channel_buffer = Mock(return_value=True)
+ print c.create_buffer()
+ print c.rename()
+ print c.current_short_name
+ print c.formatted_name()
+ print c.rename()
+ print c.formatted_name()
+# assert False