# Path: srsly/tests/ruamel_yaml/roundtrip.py
# def dedent(data):
#     try:
#         position_of_first_newline = data.index("\n")
#         for idx in range(position_of_first_newline):
#             if not data[idx].isspace():
#                 raise ValueError
#     except ValueError:
#         pass
#     else:
#         data = data[position_of_first_newline + 1 :]
#     return textwrap.dedent(data)
# 
# def round_trip_load(inp, preserve_quotes=None, version=None):
#     import srsly.ruamel_yaml  # NOQA
# 
#     dinp = dedent(inp)
#     return srsly.ruamel_yaml.load(
#         dinp,
#         Loader=srsly.ruamel_yaml.RoundTripLoader,
#         preserve_quotes=preserve_quotes,
#         version=version,
#     )
# 
# def round_trip_dump(
#     data,
#     stream=None,
#     indent=None,
#     block_seq_indent=None,
#     top_level_colon_align=None,
#     prefix_colon=None,
#     explicit_start=None,
#     explicit_end=None,
#     version=None,
# ):
#     import srsly.ruamel_yaml  # NOQA
# 
#     return srsly.ruamel_yaml.round_trip_dump(
#         data,
#         stream=stream,
#         indent=indent,
#         block_seq_indent=block_seq_indent,
#         top_level_colon_align=top_level_colon_align,
#         prefix_colon=prefix_colon,
#         explicit_start=explicit_start,
#         explicit_end=explicit_end,
#         version=version,
#     )


import pytest  # NOQA
from .roundtrip import dedent, round_trip_load, round_trip_dump
# coding: utf-8

from __future__ import print_function, absolute_import, division, unicode_literals



# http://yaml.org/type/int.html is where underscores in integers are defined


class TestBinHexOct:
    def test_calculate(self):
        # make sure type, leading zero(s) and underscore are preserved
        s = dedent(
            """\
        - 42
        - 0b101010
        - 0x_2a
        - 0x2A
        - 0o00_52
        """
        )

# Path: srsly/tests/ruamel_yaml/roundtrip.py
# def dedent(data):
#     try:
#         position_of_first_newline = data.index("\n")
#         for idx in range(position_of_first_newline):
#             if not data[idx].isspace():
#                 raise ValueError
#     except ValueError:
#         pass
#     else:
#         data = data[position_of_first_newline + 1 :]
#     return textwrap.dedent(data)
# 
# def round_trip_load(inp, preserve_quotes=None, version=None):
#     import srsly.ruamel_yaml  # NOQA
# 
#     dinp = dedent(inp)
#     return srsly.ruamel_yaml.load(
#         dinp,
#         Loader=srsly.ruamel_yaml.RoundTripLoader,
#         preserve_quotes=preserve_quotes,
#         version=version,
#     )
# 
# def round_trip_dump(
#     data,
#     stream=None,
#     indent=None,
#     block_seq_indent=None,
#     top_level_colon_align=None,
#     prefix_colon=None,
#     explicit_start=None,
#     explicit_end=None,
#     version=None,
# ):
#     import srsly.ruamel_yaml  # NOQA
# 
#     return srsly.ruamel_yaml.round_trip_dump(
#         data,
#         stream=stream,
#         indent=indent,
#         block_seq_indent=block_seq_indent,
#         top_level_colon_align=top_level_colon_align,
#         prefix_colon=prefix_colon,
#         explicit_start=explicit_start,
#         explicit_end=explicit_end,
#         version=version,
#     )


# Path: srsly/tests/ruamel_yaml/test_int.py
import pytest  # NOQA
from .roundtrip import dedent, round_trip_load, round_trip_dump

# coding: utf-8

from __future__ import print_function, absolute_import, division, unicode_literals



# http://yaml.org/type/int.html is where underscores in integers are defined


class TestBinHexOct:
    def test_calculate(self):
        # make sure type, leading zero(s) and underscore are preserved
        s = dedent(
            """\
        - 42
        - 0b101010
        - 0x_2a
        - 0x2A
        - 0o00_52
        """
        )

        d = round_trip_load(s)