-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
142 additions
and
105 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.coverage | ||
.idea | ||
*.pyc | ||
rezoirclogs.egg-info | ||
.venv* | ||
__pycache__ |
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,5 @@ | ||
{ | ||
"flake8.args": [ | ||
"--max-line-length=120" | ||
] | ||
} |
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
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 |
---|---|---|
|
@@ -61,7 +61,7 @@ def test_read(self): | |
import os | ||
import tempfile | ||
f = tempfile.NamedTemporaryFile() | ||
f.write('hello') | ||
f.write(b'hello') | ||
f.flush() | ||
fs = self._make_one(os.path.dirname(f.name)) | ||
self.assertEqual(fs.open(f.name).read(), 'hello') | ||
|
@@ -71,17 +71,17 @@ def test_read(self): | |
class LogFileTests(unittest2.TestCase): | ||
def test_iter(self): | ||
class Fs(object): | ||
def open(self, path): | ||
return """01:47 -!- K-Yo [[email protected]] has joined #teamrezo | ||
def open(self, path): | ||
return """01:47 -!- K-Yo [[email protected]] has joined #teamrezo | ||
01:47 <ciblout> kage: demain matin, quand tu veux | ||
01:48 * ciblout mange une pomme""".split('\n') | ||
|
||
from rezoirclogs.resources import LogFile | ||
logfile = LogFile(Fs(), '', '20100409') | ||
l = list(logfile) | ||
self.assertEqual(l[0].type, 'status') | ||
self.assertEqual(l[1].type, 'normal') | ||
self.assertEqual(l[2].type, 'me') | ||
lf = list(logfile) | ||
self.assertEqual(lf[0].type, 'status') | ||
self.assertEqual(lf[1].type, 'normal') | ||
self.assertEqual(lf[2].type, 'me') | ||
|
||
|
||
class ChanTests(unittest2.TestCase): | ||
|
@@ -123,10 +123,10 @@ def test_previous_next_chan(self): | |
|
||
def test_last(self): | ||
chan = self._make_one() | ||
l = chan.last(5) | ||
self.assertEqual(len(l), 2) | ||
self.assertEqual(l[0].__name__, '20100204') | ||
self.assertEqual(l[1].__name__, '20100203') | ||
lf = chan.last(5) | ||
self.assertEqual(len(lf), 2) | ||
self.assertEqual(lf[0].__name__, '20100204') | ||
self.assertEqual(lf[1].__name__, '20100203') | ||
|
||
|
||
class DirectoryTests(unittest2.TestCase): | ||
|
@@ -225,7 +225,7 @@ def test_search_logfile_after_date(self): | |
from rezoirclogs.resources import LogFile | ||
from datetime import date | ||
lf = LogFile(self._get_fs(), '#tagada.20101101.log', '20101101') | ||
result = list(lf.search("flower", date(2012,12,12))) | ||
result = list(lf.search("flower", date(2012, 12, 12))) | ||
self.assertEqual(result, []) | ||
|
||
|
||
|
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
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
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
Oops, something went wrong.