This repository has been archived by the owner on Jul 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work to convert into proper test cases
- Loading branch information
Showing
5 changed files
with
61 additions
and
25 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
# Test the various hashing methods | ||
import unittest | ||
import logging | ||
logging.basicConfig(level=logging.WARNING) | ||
import gntp.notifier | ||
|
||
class Growler(gntp.notifier.GrowlNotifier): | ||
applicationName = 'GNTP unittest' | ||
hostname = 'localhost' | ||
port = 23053 | ||
notifications=['Testing'] | ||
def hash_test(self,hashName): | ||
self.passwordHash = hashName | ||
return self.notify('Testing','Testing Hash',hashName) | ||
|
||
class TestHash(unittest.TestCase): | ||
def setUp(self): | ||
self.growl = Growler() | ||
self.growl.register() | ||
def test_md5(self): | ||
self.assertTrue( self.growl.hash_test('MD5') ) | ||
def test_sha1(self): | ||
self.assertTrue( self.growl.hash_test('SHA1') ) | ||
def test_sha256(self): | ||
self.assertTrue( self.growl.hash_test('SHA256') ) | ||
def test_sha512(self): | ||
self.assertTrue( self.growl.hash_test('512') ) | ||
def test_fake(self): | ||
'''Fake hash should not work''' | ||
self.assertFalse( self.growl.hash_test('fake-hash') ) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# Simple script to test sending UTF8 text with the GrowlNotifier class | ||
import unittest | ||
import logging | ||
logging.basicConfig(level=logging.WARNING) | ||
import gntp.notifier | ||
|
||
class Growler(gntp.notifier.GrowlNotifier): | ||
applicationName = 'GNTP unittest' | ||
hostname = 'localhost' | ||
port = 23053 | ||
notifications=['Testing'] | ||
|
||
class TestHash(unittest.TestCase): | ||
def setUp(self): | ||
self.growl = Growler() | ||
self.growl.register() | ||
def test_english(self): | ||
self.growl.notify('Testing','Testing','Hello') | ||
def test_extra(self): | ||
self.growl.notify('Testing','Testing','allô') | ||
def test_japanese(self): | ||
self.growl.notify('Testing','Testing',u'おはおう') | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file was deleted.
Oops, something went wrong.