Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #769 from bmorg/fix_seedlink_multithread
Fixed obspy.seedlink bugs caused by mixed usage of class/instance attributes. Fixes #561.
- Loading branch information
Showing
6 changed files
with
82 additions
and
30 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
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
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,30 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
The obspy.seedlink.client.slnetstation test suite. | ||
""" | ||
from obspy.seedlink.client.slnetstation import SLNetStation | ||
import unittest | ||
|
||
|
||
class SLNetStationTestCase(unittest.TestCase): | ||
|
||
def test_issue769(self): | ||
""" | ||
Assure that different station objects don't share selector lists. | ||
""" | ||
station1 = SLNetStation('', '', None, -1, None) | ||
station2 = SLNetStation('', '', None, -1, None) | ||
|
||
station1.appendSelectors('FOO') | ||
|
||
self.assertNotEqual(id(station1.selectors), id(station2.selectors)) | ||
self.assertEqual(station1.getSelectors(), ['FOO']) | ||
self.assertEqual(station2.getSelectors(), []) | ||
|
||
|
||
def suite(): | ||
return unittest.makeSuite(SLNetStationTestCase, 'test') | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main(defaultTest='suite') |
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,28 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
The obspy.seedlink.client.slstate test suite. | ||
""" | ||
from obspy.core.util.decorator import skipIf | ||
from obspy.seedlink.client.slstate import SLState | ||
import unittest | ||
|
||
|
||
class SLStateTestCase(unittest.TestCase): | ||
|
||
def test_issue561(self): | ||
""" | ||
Assure that different state objects don't share data buffers. | ||
""" | ||
slstate1 = SLState() | ||
slstate2 = SLState() | ||
|
||
self.assertNotEqual(id(slstate1.databuf), id(slstate2.databuf)) | ||
self.assertNotEqual(id(slstate1.packed_buf), id(slstate2.packed_buf)) | ||
|
||
|
||
def suite(): | ||
return unittest.makeSuite(SLStateTestCase, 'test') | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main(defaultTest='suite') |