-
Notifications
You must be signed in to change notification settings - Fork 9
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 #33 from astrofrog/fix-bytes
Finish fixing bytes issues
- Loading branch information
Showing
10 changed files
with
65 additions
and
40 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
import os | ||
from ..avm import AVM | ||
|
||
ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') | ||
|
||
|
||
def test_from_image_jpg(): | ||
avm = AVM.from_image(os.path.join(ROOT, 'eso_eso1723a_320.jpg')) | ||
assert avm.ID == 'eso1723a' | ||
|
||
|
||
def test_from_image_png(): | ||
avm = AVM.from_image(os.path.join(ROOT, 'eso_eso1723a_320.png')) | ||
assert avm.ID == 'eso1723a' | ||
|
||
|
||
def test_from_image_other(tmpdir): | ||
# Here we test the brute-force search | ||
with open(os.path.join(ROOT, '3c321.avm.xml'), 'rb') as f: | ||
content = f.read() | ||
filename = tmpdir.join('testfile').strpath | ||
with open(filename, 'wb') as f: | ||
f.write(b'<?xpacket begin="<\ufeff>" id="W5M0MpCehiHzreSzNTczkc9d"?>') | ||
f.write(content) | ||
f.write(b'</x:xmpmeta>') | ||
avm = AVM.from_image(filename) | ||
assert avm.Publisher == 'Chandra X-ray Observatory' |
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