
from boltons import strutils


def test_asciify():
    ref = u'Beyoncé'
    b = strutils.asciify(ref)
    assert len(b) == len(b)
    assert b[-1:].decode('ascii') == 'e'


def test_indent():
    to_indent = '\nabc\ndef\n\nxyz\n'
    ref = '\n  abc\n  def\n\n  xyz\n'
    assert strutils.indent(to_indent, '  ') == ref


import uuid

from boltons import strutils


def test_asciify():
    ref = u'Beyoncé'
    b = strutils.asciify(ref)
    assert len(b) == len(b)
    assert b[-1:].decode('ascii') == 'e'


def test_indent():
    to_indent = '\nabc\ndef\n\nxyz\n'
    ref = '\n  abc\n  def\n\n  xyz\n'
    assert strutils.indent(to_indent, '  ') == ref


def test_is_uuid():
    assert strutils.is_uuid(uuid.uuid4()) == True
    assert strutils.is_uuid(uuid.uuid4(), version=1) == False
    assert strutils.is_uuid(str(uuid.uuid4())) == True
    assert strutils.is_uuid(str(uuid.uuid4()), version=1) == False
    assert strutils.is_uuid(set('garbage')) == False

Add is_uuid unit-tests, including garbage types.
Add is_uuid unit-tests, including garbage types.

+ 
+ import uuid
  
  from boltons import strutils
  
  
  def test_asciify():
      ref = u'Beyoncé'
      b = strutils.asciify(ref)
      assert len(b) == len(b)
      assert b[-1:].decode('ascii') == 'e'
  
  
  def test_indent():
      to_indent = '\nabc\ndef\n\nxyz\n'
      ref = '\n  abc\n  def\n\n  xyz\n'
      assert strutils.indent(to_indent, '  ') == ref
  
+ 
+ def test_is_uuid():
+     assert strutils.is_uuid(uuid.uuid4()) == True
+     assert strutils.is_uuid(uuid.uuid4(), version=1) == False
+     assert strutils.is_uuid(str(uuid.uuid4())) == True
+     assert strutils.is_uuid(str(uuid.uuid4()), version=1) == False
+     assert strutils.is_uuid(set('garbage')) == False
+ 
Add is_uuid unit-tests, including garbage types.
## Code Before:

from boltons import strutils


def test_asciify():
    ref = u'Beyoncé'
    b = strutils.asciify(ref)
    assert len(b) == len(b)
    assert b[-1:].decode('ascii') == 'e'


def test_indent():
    to_indent = '\nabc\ndef\n\nxyz\n'
    ref = '\n  abc\n  def\n\n  xyz\n'
    assert strutils.indent(to_indent, '  ') == ref

## Instruction:
Add is_uuid unit-tests, including garbage types.
## Code After:

import uuid

from boltons import strutils


def test_asciify():
    ref = u'Beyoncé'
    b = strutils.asciify(ref)
    assert len(b) == len(b)
    assert b[-1:].decode('ascii') == 'e'


def test_indent():
    to_indent = '\nabc\ndef\n\nxyz\n'
    ref = '\n  abc\n  def\n\n  xyz\n'
    assert strutils.indent(to_indent, '  ') == ref


def test_is_uuid():
    assert strutils.is_uuid(uuid.uuid4()) == True
    assert strutils.is_uuid(uuid.uuid4(), version=1) == False
    assert strutils.is_uuid(str(uuid.uuid4())) == True
    assert strutils.is_uuid(str(uuid.uuid4()), version=1) == False
    assert strutils.is_uuid(set('garbage')) == False
