-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Meaningful error message if attempting to overwrite the
df
attribute (
#29)
- Loading branch information
Showing
7 changed files
with
94 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# BioPandas | ||
# Author: Sebastian Raschka <mail@sebastianraschka.com> | ||
# License: BSD 3 clause | ||
# Project Website: http://rasbt.github.io/biopandas/ | ||
# Code Repository: https://github.com/rasbt/biopandas | ||
|
||
from biopandas.pdb import PandasPdb | ||
from biopandas.testutils import assert_raises | ||
import os | ||
|
||
|
||
TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), 'data', '3eiy.pdb') | ||
|
||
|
||
def test_overwrite_df(): | ||
data_path = os.path.join(os.path.dirname(__file__), 'data', '3eiy.pdb') | ||
pdb = PandasPdb().read_pdb(data_path) | ||
|
||
def overwrite(): | ||
pdb.df = 'bla' | ||
|
||
expect = ('Please use `PandasPdb.df_ = ... ` instead\n' | ||
'of `PandasPdb.df = ... ` if you are sure that\n' | ||
'you want to overwrite the `df` attribute.') | ||
|
||
assert_raises(AttributeError, | ||
expect, | ||
overwrite) |
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