[15:11] <Saviq> elopio, hi, it's your favourite I-bug-you, any idea how to get rid of \ in https://github.com/Saviq/nova-compute-lxd/pull/3/files#diff-c80fca5016bdd3c8916dac9e8ba9a9fcR52 ?
[15:11] <Saviq> I tried everything I could think of with (), but no go :/
[15:12] <elopio> Saviq: many patches, that smells like not-so-easy to test code.
[15:12] <elopio> Saviq: but, you can make a patch, and then start it
[15:13] <elopio> instead of putting it inside the with statement.
[15:13] <Saviq> elopio, yeah i was considering that, but that works and am quite happy, the only problem is I've no idea how to wrap without \
[15:13] <elopio> Saviq: well, \ is not wrong.
[15:14] <Saviq> elopio, sure, was just wondering if there's a solution :)
[15:14] <Saviq> elopio, fwiw, here's the tested function https://github.com/Saviq/nova-compute-lxd/blob/travis/nclxd/nova/virt/lxd/container_config.py#L50
[15:15] <Saviq> there's a lot of self.foo() calls, hence all the mocks...
[15:15] <elopio> Saviq: ok, give me some moments and I'll check it.
[15:16] <Saviq> I could move the patches a level up, tried to keep the test low level, though
[15:16] <Saviq> elopio, thank
[15:16] <Saviq> s
[16:47] <elopio> Saviq: sorry, long meeting and then forgot about you.
[16:48] <elopio> Saviq: why do you have to patch something like _init_container_config
[16:48] <elopio> doesn't seem to be slow, or to have any side-effects
[16:50] <elopio> it's an internal method, so you probably shouldn't write a unit test for it, but check it's behaviour through the public method that calls it.
[16:54] <elopio> yes, too many mocks. That usually happens when you try to do full coverage, but don't follow tdd.
[16:55] <elopio> Saviq: I would recommend to split the tests. I use a trick that if I can't properly name the test, it's probably wrong.
[16:56] <elopio> write first a test that's named like: test_configure_container_with_negative_memory_must_not_limit_memory
[16:57] <elopio> then write test_configure_container_with_positive_memory_must_limit_memory.
[16:57] <elopio> try passing to those methods a flavor that causes the if mem >= 0 to be taken, and a flavor that doesn't. And then check the container_config returned.
[16:58] <elopio> afai can see, you shouldn't need a mock to test that.
[17:12] <Saviq> elopio, right, test for _init_container_config is probably overkill
[17:12] <Saviq> elopio, and yeah, unfortunately I'm sticking tests on all that post-factum
[17:16] <Saviq> mocking add_config probably doesn't make sense either, now I think of it
[17:39] <elopio> Saviq: appart from configure_container, the rest of the method seem internal to me.
[17:39] <elopio> maybe ask why are they public?
[17:39] <Saviq> elopio, could be indeed, will check if they're even called anywhere et
[19:37] <balloons> bunosera Letozaf_ !
[19:38] <Letozaf_> buonasera balloons :) howzit ?
[19:38] <balloons> excellente. I was just talking with Akiva about the AP plugin
[19:38] <balloons> I was just thinking about those bugs you found.. do you mind filing them?
[19:39] <Letozaf_> balloons, I will, I was just fighting getting Thunderbird to work, but I will just now
[19:50] <Letozaf_> balloons, bug 1474108
[19:57] <balloons> bug #1474108
[19:59] <Letozaf_> balloons, :-P forgot #
[20:00] <balloons> Letozaf_, the bot doesn't love us today.. No linky or print
[20:03] <Letozaf_> balloons, :-)
[20:29] <Letozaf_> balloons, bug #1474117 and bug #1474119