Ejemplo n.º 1
0
	def test_colors_config_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/colors': {
				'colors': {
					'c1': 3,
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{32} bt{2-}#>{--}')
		with WithConfigTree(mdc(main_tree(), {
			'2/colors': {
				'colors': {
					'c1': 3,
				}
			},
			'3/colors': {
				'colors': {
					'c1': 4,
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{42} bt{2-}#>{--}')
		with WithConfigTree(mdc(main_tree(), {
			'2/colors': {
				'colors': {
					'c1': 3,
				}
			},
			'3/colors': {
				'colors': {
					'c2': 4,
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{34} bt{4-}#>{--}')
Ejemplo n.º 2
0
	def test_colors_config_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/colors': {
				'colors': {
					'c1': 3,
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{32} bt{2-}#>{--}')
		with WithConfigTree(mdc(main_tree(), {
			'2/colors': {
				'colors': {
					'c1': 3,
				}
			},
			'3/colors': {
				'colors': {
					'c1': 4,
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{42} bt{2-}#>{--}')
		with WithConfigTree(mdc(main_tree(), {
			'2/colors': {
				'colors': {
					'c1': 3,
				}
			},
			'3/colors': {
				'colors': {
					'c2': 4,
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{34} bt{4-}#>{--}')
Ejemplo n.º 3
0
 def test_root_config_merging(self):
     with WithConfigTree(
             mdc(main_tree(), {
                 '2/config': {
                     'common': {
                         'default_top_theme': 'other1',
                     }
                 },
             })) as p:
         self.assertRenderEqual(p, '{12} bt{2-}!>{--}')
     with WithConfigTree(
             mdc(
                 main_tree(), {
                     '2/config': {
                         'common': {
                             'default_top_theme': 'other1',
                         }
                     },
                     '3/config': {
                         'common': {
                             'default_top_theme': 'other2',
                         }
                     },
                 })) as p:
         self.assertRenderEqual(p, '{12} bt{2-}>>{--}')
Ejemplo n.º 4
0
	def test_colorschemes_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/colorschemes/default': {
				'groups': {
					'g': {'fg': 'c2', 'bg': 'c1', 'attrs': []},
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{21} bt{1-}#>{--}')
Ejemplo n.º 5
0
	def test_colorschemes_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/colorschemes/default': {
				'groups': {
					'g': {'fg': 'c2', 'bg': 'c1', 'attrs': []},
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{21} bt{1-}#>{--}')
Ejemplo n.º 6
0
	def test_theme_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/themes/test/default': {
				'segment_data': {
					's': {
						'after': 'a',
					}
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{12} bta{2-}#>{--}')
Ejemplo n.º 7
0
	def test_theme_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/themes/test/default': {
				'segment_data': {
					's': {
						'after': 'a',
					}
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{12} bta{2-}#>{--}')
Ejemplo n.º 8
0
	def test_root_config_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/config': {
				'common': {
					'default_top_theme': 'other1',
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{12} bt{2-}!>{--}')
		with WithConfigTree(mdc(main_tree(), {
			'2/config': {
				'common': {
					'default_top_theme': 'other1',
				}
			},
			'3/config': {
				'common': {
					'default_top_theme': 'other2',
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{12} bt{2-}>>{--}')
Ejemplo n.º 9
0
	def test_top_theme_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/themes/' + UT: {
				'spaces': 1,
			},
			'3/themes/' + UT: {
				'dividers': {
					'left': {
						'hard': '>>',
					}
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{12} bt {2-}>>{--}')
Ejemplo n.º 10
0
	def test_top_theme_merging(self):
		with WithConfigTree(mdc(main_tree(), {
			'2/themes/' + UT: {
				'spaces': 1,
			},
			'3/themes/' + UT: {
				'dividers': {
					'left': {
						'hard': '>>',
					}
				}
			},
		})) as p:
			self.assertRenderEqual(p, '{12} bt {2-}>>{--}')
Ejemplo n.º 11
0
		},
	},
	'spaces': 0,
}


main_tree = lambda: {
	'1/config': root_config(),
	'1/colors': colors_config(),
	'1/colorschemes/default': colorscheme_config(),
	'1/themes/test/default': theme_config(),
	'1/themes/' + UT: top_theme_config(),
	'1/themes/other1': mdc(top_theme_config(), {
		'dividers': {
			'left': {
				'hard': '!>',
			}
		}
	}),
	'1/themes/other2': mdc(top_theme_config(), {
		'dividers': {
			'left': {
				'hard': '>>',
			}
		}
	}),
}


def mkdir_recursive(directory):
	if os.path.isdir(directory):
Ejemplo n.º 12
0
main_tree = lambda: {
    '1/config':
    root_config(),
    '1/colors':
    colors_config(),
    '1/colorschemes/default':
    colorscheme_config(),
    '1/themes/test/default':
    theme_config(),
    '1/themes/' + UT:
    top_theme_config(),
    '1/themes/other1':
    mdc(top_theme_config(), {'dividers': {
        'left': {
            'hard': '!>',
        }
    }}),
    '1/themes/other2':
    mdc(top_theme_config(), {'dividers': {
        'left': {
            'hard': '>>',
        }
    }}),
}


def mkdir_recursive(directory):
    if os.path.isdir(directory):
        return
    mkdir_recursive(os.path.dirname(directory))
Ejemplo n.º 13
0
		},
	},
	'spaces': 0,
}


main_tree = lambda: {
	'1/config': root_config(),
	'1/colors': colors_config(),
	'1/colorschemes/default': colorscheme_config(),
	'1/themes/test/default': theme_config(),
	'1/themes/' + UT: top_theme_config(),
	'1/themes/other1': mdc(top_theme_config(), {
		'dividers': {
			'left': {
				'hard': '!>',
			}
		}
	}),
	'1/themes/other2': mdc(top_theme_config(), {
		'dividers': {
			'left': {
				'hard': '>>',
			}
		}
	}),
}


def mkdir_recursive(directory):
	if os.path.isdir(directory):