Skip to content

Commit

Permalink
ceph-volume tests.util verify as_bytes behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 1802c38)
  • Loading branch information
Alfredo Deza committed Jul 27, 2018
1 parent 6182f49 commit f89139e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ceph-volume/ceph_volume/tests/util/test_util.py
Expand Up @@ -2,6 +2,17 @@
from ceph_volume import util


class TestAsBytes(object):

def test_bytes_just_gets_returned(self):
bytes_string = "contents".encode('utf-8')
assert util.as_bytes(bytes_string) == bytes_string

def test_string_gets_converted_to_bytes(self):
result = util.as_bytes('contents')
assert isinstance(result, bytes)


class TestStrToInt(object):

def test_passing_a_float_str(self):
Expand Down

0 comments on commit f89139e

Please sign in to comment.