~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to test/utils.py

  • Committer: Olivier Tilloy
  • Date: 2012-03-15 09:31:06 UTC
  • mfrom: (373.1.1 empty-undefined-value)
  • Revision ID: olivier@tilloy.net-20120315093106-zg28lb2wa19odvcp
Fix undefined_to_string to accept empty strings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# ******************************************************************************
4
4
#
5
 
# Copyright (C) 2010 Olivier Tilloy <olivier@tilloy.net>
 
5
# Copyright (C) 2010-2012 Olivier Tilloy <olivier@tilloy.net>
6
6
#
7
7
# This file is part of the pyexiv2 distribution.
8
8
#
36
36
    def test_undefined_to_string(self):
37
37
        self.assertEqual(undefined_to_string("48 50 50 49"), "0221")
38
38
        self.assertEqual(undefined_to_string("48 50 50 49 "), "0221")
39
 
        self.assertRaises(ValueError, undefined_to_string, "")
 
39
        self.assertEqual(undefined_to_string(""), "")
40
40
        self.assertRaises(ValueError, undefined_to_string, "foo")
41
41
        self.assertRaises(ValueError, undefined_to_string, "48 50  50 49")
42
42