diff --git a/lbry/console.py b/lbry/console.py index e6aead20e..702e57a41 100644 --- a/lbry/console.py +++ b/lbry/console.py @@ -111,8 +111,8 @@ class Bar2(Bar): def __format__(self, format_spec): width = self.default_len - row1 = (1,)*int(self.frac * width * 2) - row2 = (2,)*int(self.frac2 * width * 2) + row1 = (1,)*int(self.frac2 * width * 2) + row2 = (2,)*int(self.frac * width * 2) fill = [] for one, two, _ in itertools.zip_longest(row1, row2, range(width*2)): fill.append((one or 0)+(two or 0)) diff --git a/tests/unit/test_console.py b/tests/unit/test_console.py index c21675489..e5f2ad845 100644 --- a/tests/unit/test_console.py +++ b/tests/unit/test_console.py @@ -9,20 +9,20 @@ class TestBar2(unittest.TestCase): def test_rendering(self): self.bar(0.00, 0.00, ' ') - self.bar(0.00, 0.05, '▖ ') - self.bar(0.05, 0.00, '▘ ') + self.bar(0.05, 0.00, '▖ ') + self.bar(0.00, 0.05, '▘ ') self.bar(0.05, 0.05, '▌ ') - self.bar(0.00, 0.10, '▄ ') - self.bar(0.10, 0.00, '▀ ') - self.bar(0.05, 0.10, '▙ ') - self.bar(0.10, 0.05, '▛ ') - self.bar(0.30, 0.50, '███▄▄ ') - self.bar(0.35, 0.55, '███▙▄▖ ') - self.bar(0.40, 0.60, '████▄▄ ') - self.bar(0.50, 0.30, '███▀▀ ') - self.bar(0.55, 0.35, '███▛▀▘ ') - self.bar(0.60, 0.40, '████▀▀ ') - self.bar(0.95, 0.90, '█████████▘') - self.bar(0.99, 0.98, '█████████▌') - self.bar(0.99, 1.00, '█████████▙') + self.bar(0.10, 0.00, '▄ ') + self.bar(0.00, 0.10, '▀ ') + self.bar(0.10, 0.05, '▙ ') + self.bar(0.05, 0.10, '▛ ') + self.bar(0.50, 0.30, '███▄▄ ') + self.bar(0.55, 0.35, '███▙▄▖ ') + self.bar(0.60, 0.40, '████▄▄ ') + self.bar(0.30, 0.50, '███▀▀ ') + self.bar(0.35, 0.55, '███▛▀▘ ') + self.bar(0.40, 0.60, '████▀▀ ') + self.bar(0.90, 0.95, '█████████▘') + self.bar(0.98, 0.99, '█████████▌') + self.bar(1.00, 0.99, '█████████▙') self.bar(1.00, 1.00, '██████████')