summaryrefslogtreecommitdiff
path: root/tools/python_test.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2016-12-26 07:41:17 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2016-12-26 07:41:17 +0100
commitd3d8bafa22e271e75e92a3df205e533bfe2e7d11 (patch)
tree5a2ca50ea173d379d3377273643257f0a3848dbd /tools/python_test.py
parent064e2b4bb7cb4b1775a78f51ebb46a00c9733af9 (diff)
downloadgitlab-d3d8bafa22e271e75e92a3df205e533bfe2e7d11.tar.gz
Add functional tests for Snippet
Diffstat (limited to 'tools/python_test.py')
-rw-r--r--tools/python_test.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/python_test.py b/tools/python_test.py
index 0c065b8..abfa508 100644
--- a/tools/python_test.py
+++ b/tools/python_test.py
@@ -289,3 +289,18 @@ settings.level = gitlab.NOTIFICATION_LEVEL_WATCH
settings.save()
settings = gl.notificationsettings.get()
assert(settings.level == gitlab.NOTIFICATION_LEVEL_WATCH)
+
+# snippets
+snippets = gl.snippets.list()
+assert(len(snippets) == 0)
+snippet = gl.snippets.create({'title': 'snippet1', 'file_name': 'snippet1.py',
+ 'content': 'import gitlab'})
+snippet = gl.snippets.get(1)
+snippet.title = 'updated_title'
+snippet.save()
+snippet = gl.snippets.get(1)
+assert(snippet.title == 'updated_title')
+content = snippet.raw()
+assert(content == 'import gitlab')
+snippet.delete()
+assert(len(gl.snippets.list()) == 0)