# Path: luna/utils/freelist.py
# def next_free(flist):
# def unfree_range(flist, start, end=None):
# def free_range(flist, start, end=None):
# def set_upper_limit(flist, end, prev_end):
# def get_nonfree(flist, limit=None):


import mock
import unittest
import os
from luna.utils import freelist



class UtilsFreelistTests(unittest.TestCase):

    def setUp(self):
        print
        self.flist0 = []
        self.flist1 = [{'start': 1, 'end': 254}]
        self.flist2 = [{'start': 10, 'end': 18}, {'start': 20, 'end': 254}]
        self.flist3 = [{'start': 254, 'end': 254}]
        self.flist4 = [{'start': 10, 'end': 10}, {'start': 12, 'end': 254}]

    def test_next_free(self):

        # Simple freelist


# Path: luna/utils/freelist.py
# def next_free(flist):
# def unfree_range(flist, start, end=None):
# def free_range(flist, start, end=None):
# def set_upper_limit(flist, end, prev_end):
# def get_nonfree(flist, limit=None):


# Path: tests/unittests/test_utils_freelist.py
import mock
import unittest
import os
from luna.utils import freelist




class UtilsFreelistTests(unittest.TestCase):

    def setUp(self):
        print
        self.flist0 = []
        self.flist1 = [{'start': 1, 'end': 254}]
        self.flist2 = [{'start': 10, 'end': 18}, {'start': 20, 'end': 254}]
        self.flist3 = [{'start': 254, 'end': 254}]
        self.flist4 = [{'start': 10, 'end': 10}, {'start': 12, 'end': 254}]

    def test_next_free(self):

        # Simple freelist


        flist, next_free = freelist.next_free(self.flist1)