Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit ea2ec6b

Browse files
committed
Add tests
1 parent cea43d8 commit ea2ec6b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_issues.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,20 @@ def test_issue_63():
2424
assert all(len(df) == 1 for df in result)
2525
os.remove('tmp_1.root')
2626
os.remove('tmp_2.root')
27+
28+
29+
def test_issue_80():
30+
df = pd.DataFrame({'a': [1, 2], 'b': [4, 5]})
31+
df.columns = ['a', 'a']
32+
try:
33+
root_pandas.to_root(df, '/tmp/example.root')
34+
except ValueError as e:
35+
assert 'DataFrame contains duplicated column names' in e.args[0]
36+
else:
37+
raise Exception('ValueError is expected')
38+
39+
40+
def test_issue_82():
41+
variables = ['MET_px', 'MET_py', 'EventWeight']
42+
df = root_pandas.read_root('http://scikit-hep.org/uproot/examples/HZZ.root', 'events', columns=variables)
43+
assert list(df.columns) == variables

0 commit comments

Comments
 (0)